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 219115 - NetBeans throws JavaScript's TypeError when running default index.html
Summary: NetBeans throws JavaScript's TypeError when running default index.html
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: Inspection (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Stola
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-27 14:37 UTC by Vladimir Riha
Modified: 2012-10-15 06:02 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2012-09-27 14:37:16 UTC
To reproduce:
- create a new HTML/JavaScript project, no JS libraries or templates
- run the index.html


In Output|Browser Log, you can see

Uncaught TypeError: Cannot read property 'getContext' of null (16:32:10:035 | error, javascript)
    at NetBeans.repaintGlassPane (:177:15)




Sorry if the issue doesn't belong here.


Product Version: NetBeans IDE 7.3 Beta (Build 201209261812)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-31-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Tomas Mysik 2012-10-01 08:37:18 UTC
Davide, do you have an idea what it could be? Thanks.
Comment 2 David Konecny 2012-10-02 05:24:55 UTC
I saw it too. That's an error in the JavaScript which page inspector dynamically inject into the HTML document.
Comment 3 Jan Stola 2012-10-02 09:50:51 UTC
I am not able to reproduce this issue, but the error message shows clearly that NetBeans.repaintGlassPane() was called before injection of canvas element was completed. I have modified the corresponding code to handle this race condition more gracefully.

Modified file: http://hg.netbeans.org/web-main/rev/016d0e0347ff
Comment 4 Vladimir Riha 2012-10-15 06:02:41 UTC
I haven't seen it for a while, so verifying. Thanks.


Product Version: NetBeans IDE Dev (Build 201210150002)
Java: 1.7.0_10-ea; Java HotSpot(TM) Client VM 23.6-b03
System: Linux version 3.2.0-31-generic-pae running on i386; UTF-8; en_US (nb)