From e38cd3c7f1247edebfb33242736a79fe0dee01d3 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Wed, 18 Mar 2015 07:04:30 +0100 Subject: [PATCH] Firefox: check for non-existent button --- platform/firefox/vapi-background.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 7520aec..6d3146a 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -1019,7 +1019,7 @@ var httpObserver = { // Guard against stale instances not having been unregistered if ( this.componentRegistrar.isCIDRegistered(this.classID) ) { try { - this.componentRegistrar.unregisterFactory(this.classID, Components.manager.getClassObject(this.classID, Ci.nsIFactory)) + this.componentRegistrar.unregisterFactory(this.classID, Components.manager.getClassObject(this.classID, Ci.nsIFactory)); } catch (ex) { console.error('µBlock> httpObserver > unable to unregister stale instance: ', ex); } @@ -1839,6 +1839,9 @@ var optionsObserver = { setupOptionsButton: function(doc, id, page) { var button = doc.getElementById(id); + if ( button === null ) { + return; + } button.addEventListener('command', function() { vAPI.tabs.open({ url: page, index: -1 }); });