Closed Bug 702556 Opened 13 years ago Closed 13 years ago

JS exception "aTabs[0].linkedBrowser is null" in nsSessionStore.js

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 11

People

(Reporter: heycam, Assigned: zpao)

References

Details

Attachments

(1 file)

During a few browser chrome mochitests, we get messages like the following in the log:

TEST-INFO | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser/browser_588426.js | Console message: [JavaScript Error: "aTabs[0].linkedBrowser is null" {file: "resource:///components/nsSessionStore.js" line: 2982}]

(This is currently not reported as a test failure, although some local patches I have cause it to be.)
I see what the problem is there... Fallout from changing the way we store some data. In this case __SS_tabStillLoading is now on the tab's browser instead of put into tabData so we're checking a less safe place (which in this case doesn't exist).
Blocks: 698565
Attached patch Patch v0.1Splinter Review
I think I got that logic right...
Assignee: nobody → paul
Attachment #574745 - Flags: review?(dietrich)
Blocks: 703176
Confirmed in https://tbpl.mozilla.org/?tree=Try&rev=f031662ebeb9 that this avoids the JS error.
Comment on attachment 574745 [details] [diff] [review]
Patch v0.1

Review of attachment 574745 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/sessionstore/src/nsSessionStore.js
@@ +2982,5 @@
>      function sss_restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap) {
>      var _this = this;
> +    // if the tab got removed before being completely restored, then skip it
> +    while (aTabs.length > 0 && (!aTabs[0].parentNode || !aTabs[0].linkedBrowser ||
> +                                !aTabs[0].linkedBrowser.__SS_tabStillLoading)) {

can you bust this out into a isFullyRestored (or whatever it makes sense to call it) helper? that would be far more explicit and readable. r=me with that change.
Attachment #574745 - Flags: review?(dietrich) → review+
https://hg.mozilla.org/mozilla-central/rev/b71dae458e87
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 11
Version: unspecified → Trunk
Blocks: 886116
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: