[tor-commits] [tor-browser/tor-browser-68.2.0esr-9.5-1] Bug 31573: Catch SessionStore.jsm exception

gk at torproject.org gk at torproject.org
Thu Nov 7 20:45:27 UTC 2019


commit 739c353b91d30238977a20b31b7ecf624c17006b
Author: Georg Koppen <gk at torproject.org>
Date:   Thu Nov 7 14:27:14 2019 +0000

    Bug 31573: Catch SessionStore.jsm exception
    
    This is a backport of the fix for Mozilla's bug 1591259.
---
 dom/push/PushComponents.jsm | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/dom/push/PushComponents.jsm b/dom/push/PushComponents.jsm
index 99b1d2baffac..fb2a601bc88d 100644
--- a/dom/push/PushComponents.jsm
+++ b/dom/push/PushComponents.jsm
@@ -88,12 +88,28 @@ PushServiceBase.prototype = {
     }
     if (topic === "sessionstore-windows-restored") {
       Services.obs.removeObserver(this, "sessionstore-windows-restored");
-      this._handleReady();
+      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.
-      this._handleReady();
+      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;
+        }
+      }
     }
   },
 



More information about the tor-commits mailing list