Bug 1148787 - Ensure that the sessionstore properties exist on the browser object before reading them; r=bnicholson
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 28 Mar 2015 13:20:18 -0400
changeset 266715 2ac3d0135bbab60d502007717a0ea4640769d190
parent 266714 77f34f458d021396cc260f35e0cf4a194d78b3a3
child 266716 178412a2fe8be1c71354385094901374b0ace38c
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs1148787
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1148787 - Ensure that the sessionstore properties exist on the browser object before reading them; r=bnicholson
mobile/android/components/SessionStore.js
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -342,18 +342,18 @@ SessionStore.prototype = {
 
   onTabClose: function ss_onTabClose(aWindow, aBrowser, aTabIndex) {
     if (this._maxTabsUndo == 0)
       return;
 
     if (aWindow.BrowserApp.tabs.length > 0) {
       // Bundle this browser's data and extra data and save in the closedTabs
       // window property
-      let data = aBrowser.__SS_data;
-      data.extData = aBrowser.__SS_extdata;
+      let data = aBrowser.__SS_data || {};
+      data.extData = aBrowser.__SS_extdata || {};
 
       this._windows[aWindow.__SSID].closedTabs.unshift(data);
       let length = this._windows[aWindow.__SSID].closedTabs.length;
       if (length > this._maxTabsUndo)
         this._windows[aWindow.__SSID].closedTabs.splice(this._maxTabsUndo, length - this._maxTabsUndo);
 
       this._lastClosedTabIndex = aTabIndex;