Commit 944a0683 authored by Georg Koppen's avatar Georg Koppen Committed by Matthew Finkel
Browse files

Bug 31573: Catch SessionStore.jsm exception

This is a backport of the fix for Mozilla's bug 1591259.
parent ab4f4391
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -88,12 +88,28 @@ PushServiceBase.prototype = {
    }
    if (topic === "sessionstore-windows-restored") {
      Services.obs.removeObserver(this, "sessionstore-windows-restored");
      try {
        this._handleReady();
      } catch (ex) {
        // NS_ERROR_NOT_AVAILABLE will get thrown for the PushService getter
        // if the PushService is disabled.
        if (ex.result != Cr.NS_ERROR_NOT_AVAILABLE) {
          throw ex;
        }
      }
      return;
    }
    if (topic === "android-push-service") {
      // Load PushService immediately.
      try {
        this._handleReady();
      } catch (ex) {
        // NS_ERROR_NOT_AVAILABLE will get thrown for the PushService getter
        // if the PushService is disabled.
        if (ex.result != Cr.NS_ERROR_NOT_AVAILABLE) {
          throw ex;
        }
      }
    }
  },