[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 739c353b91d30238977a20b31b7ecf624c17006b
Author: Georg Koppen <gk@xxxxxxxxxxxxxx>
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;
+        }
+      }
     }
   },
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits