Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 382394 - "Cannot call method 'appendChild' of null" console message after loading file navigator.
Summary: "Cannot call method 'appendChild' of null" console message after loading fil...
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.5   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.5 RC2   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-12 11:11 EDT by libing wang CLA
Modified: 2012-06-12 16:26 EDT (History)
2 users (show)

See Also:
mamacdon: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description libing wang CLA 2012-06-12 11:11:09 EDT
Running latest code @local host.
After loading navigator page, I saw error message from the browser console
Uncaught TypeError: Cannot call method 'appendChild' of null html.js:295
dojo.place html.js:295
dojo.declare.addChild _Container.js:48
dojo.declare.addChild _KeyNavContainer.js:61
CommandService._render commands.js:923
CommandService._render commands.js:939
(anonymous function) commands.js:855
dojo.hitch

Set a break point @line 923@commands.js, at the second time when it is hit you can see the exception in the stack.

Drilling into sub folders hit the same issue.

Seems UI still works but using up/down arrow keys to change selection hits similar  exception from other places in commands.js.:

Uncaught TypeError: Cannot call method 'appendChild' of null html.js:295
dojo.place html.js:295
dojo.declare.addChild _Container.js:48
dojo.declare.addChild _KeyNavContainer.js:61
Command._addMenuItem commands.js:1266
CommandService._render commands.js:1032
(anonymous function) commands.js:855
dojo.hitch
Comment 1 Mark Macdonald CLA 2012-06-12 11:21:53 EDT
I'm guessing this is related to the fix for Bug 380823...
Comment 2 Susan McCourt CLA 2012-06-12 11:45:50 EDT
Investigating.
Comment 3 Susan McCourt CLA 2012-06-12 15:47:52 EDT
The problem is a classic Eclipse bug, actually, where you've made an asynch call to a widget, but the widget could be destroyed between the time you decided to make the call and the time you run the asynch code.  The best short term fix is to check whether the widget is destroyed before you do the work.  I had to use an internal dijit field to do this.

The reason it happens is that destroy/renderCommands is being called three times in quick succession for the selection based tools.  (Opened bug 382428 to fix this but not now.)  We render menu contents asynchronously so that we don't block the UI.  So what happens is that we do:

destroy selection node
render commands  -> trigger asynch menu population
destroy selection node -> trigger asynch menu population
render commands  -> trigger asynch menu population
destroy selection node
render commands -> trigger asynch menu population

now we have 3 queued up requests to do the menu rendering, but the first two are requests to populate destroyed menus.

Preparing a fix for review.
Comment 4 Susan McCourt CLA 2012-06-12 16:08:27 EDT
commit is 374f1701c6873cc060f511eea0caddd1e10360b8
in remote branch bug382394

Mark, can you review?