This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 267845

Summary: NullPointerException at org.netbeans.modules.javascript2.source.query.SourceElementsQueryImpl$2.run
Product: javascript Reporter: Jenselme
Component: DebuggerAssignee: Martin Entlicher <mentlicher>
Status: VERIFIED FIXED    
Severity: normal CC: Jenselme, stezeb
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 226046
Attachments: stacktrace

Description Jenselme 2016-09-03 17:15:58 UTC
This issue was reported manually by Jenselme.
It already has 1 duplicates 


Build: NetBeans IDE Dev (Build 201609020002)
VM: OpenJDK 64-Bit Server VM, 25.102-b14, OpenJDK Runtime Environment, 1.8.0_102-b14
OS: Linux

User Comments:
Jenselme: With this code:

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <div>TODO write content</div>

        <script>
            function yolo() {
                bar();
            }
            
            function bar() {
                console.log('netbeans')
            }
            var t = 'nrsatuie';
            var a = {
                a: 'nrsaiute',
            };
            console.log(t);  // <--- Set a breakpoint here
            yolo();
            console.log('doned')
        </script>
    </body>
</html>

When the break point is reached, with callback window opened:

1. Step over
2. Step into to enter function. Exception occurs.




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.javascript2.source.query.SourceElementsQueryImpl$2.run(SourceElementsQueryImpl.java:105)
   at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:609)
   at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:153)
   at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:137)
   at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:204)
   at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:201)
Comment 1 Jenselme 2016-09-03 17:16:01 UTC
Created attachment 161886 [details]
stacktrace
Comment 2 Jenselme 2016-09-03 17:17:50 UTC
The exception also happens if once you are in a function you open the Callstack windwow.
Comment 3 Petr Pisl 2016-09-05 07:28:04 UTC
Reassigning to Martin.
Comment 4 Martin Entlicher 2016-09-27 16:50:35 UTC
Fixed by changeset:   300899:a58b75d3fc9e
http://hg.netbeans.org/core-main/rev/a58b75d3fc9e
Comment 5 Quality Engineering 2016-09-29 01:52:44 UTC
Integrated into 'main-silver', will be available in build *201609290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a58b75d3fc9e
User: mentlicher@netbeans.org
Log: #267845: Check the model for null.
Comment 6 Martin Entlicher 2016-12-09 09:54:30 UTC
Transplanted to release82:
http://hg.netbeans.org/releases/rev/71ea3a2da22f
Comment 7 Stepan Zebra 2016-12-13 14:18:21 UTC
verified in NB 8.2 Patch 1