Bug 1231896 - Catch exception thrown if we fail to reload session state for error page. r=bnicholson
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Fri, 11 Dec 2015 09:39:32 -0500
changeset 276442 caee0e6ab22e0084dcb65e78ebdd7407c5ba7ec4
parent 276441 7e6ca87a61bbfa4d0e907a0272f0ef3db81360ee
child 276443 8c98b5c712bfe02fa9302e2a23a21498254ba3eb
push id69162
push usercbook@mozilla.com
push dateTue, 15 Dec 2015 13:52:23 +0000
treeherdermozilla-inbound@98d65afd9826 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs1231896
milestone45.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 1231896 - Catch exception thrown if we fail to reload session state for error page. r=bnicholson
mobile/android/components/SessionStore.js
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -998,17 +998,22 @@ SessionStore.prototype = {
       }
       aHistory.addEntry(this._deserializeHistoryEntry(aTabData.entries[i], idMap, docIdentMap), true);
     }
 
     // We need to force set the active history item and cause it to reload since
     // we stop the load above
     let activeIndex = (aTabData.index || aTabData.entries.length) - 1;
     aHistory.getEntryAtIndex(activeIndex, true);
-    aHistory.QueryInterface(Ci.nsISHistory).reloadCurrentEntry();
+
+    try {
+      aHistory.QueryInterface(Ci.nsISHistory).reloadCurrentEntry();
+    } catch (e) {
+      // This will throw if the current entry is an error page.
+    }
   },
 
   /**
   * Takes serialized form text data and restores it into the given browser.
   */
   _restoreTextData: function ss_restoreTextData(aTabData, aBrowser) {
     let formdata = aTabData.formdata;
     if (formdata) {