maqetta/maqetta — Issue #1409: Exceptions when browser refresh with 3 open editors
Author: JonFerraiolo
Created: 2011-12-21 17:52:24+00:00
State: open
Labels: Priority High

I can reproduce this fairly reliably when using Mac/Chrome and launching from Eclipse.

When I have the following 3 files open in Maqetta (file12.html, file10.html and file11.html, with that as the order of the tabs, with file11.html as the active tab, see below for source code), if I navigate away from Maqetta, clear browser cache, then navigate back to Maqetta, I get this exception in the console:

```
Uncaught TypeError: Cannot read property 'parentWindow' of null dojo/window:49
```

and the current editor (file11.html) comes up empty (and sometimes so does the file12.html editor). The above console message isn't particularly useful. When I turned on all exceptions, I'm seeing that there is a caught exception at Context.js:841 in this logic where doc.body doesn't appear to have a value yet, so body.id causes an exception.

```
try {
var win = dijit.getDocumentWindow(doc),
body = (context.rootNode = doc.body);
body.id = "myapp";
```

Below are the files I have been using:

file12.html:

```

Untitled

Today's alerts:

10:30am 80% capacity

```

file10.html:

```

Untitled

```

file11.html:

```

Untitled

Sort by:

Name

Due date

Task 1

Add new task

Task name:

```