aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-06-25 09:05:24 -0400
committergorhill <rhill@raymondhill.net>2015-06-25 09:05:24 -0400
commit0afbb98f42c4037f05f10099c10f9df0ee853a7a (patch)
treef449a5996f3cafdae6a1f29765cfd4a776c4c651
parent1ba7894a299372d0baf5599d22e0617a7ab37e29 (diff)
downloaduBlock-0afbb98f42c4037f05f10099c10f9df0ee853a7a.zip
uBlock-0afbb98f42c4037f05f10099c10f9df0ee853a7a.tar.gz
uBlock-0afbb98f42c4037f05f10099c10f9df0ee853a7a.tar.bz2
this fixes #399
-rw-r--r--platform/firefox/vapi-background.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js
index 3d73648..647c4c4 100644
--- a/platform/firefox/vapi-background.js
+++ b/platform/firefox/vapi-background.js
@@ -908,6 +908,12 @@ var tabWatcher = (function() {
var currentBrowser = function() {
var win = Services.wm.getMostRecentWindow('navigator:browser');
+ // https://github.com/gorhill/uBlock/issues/399
+ // getTabBrowser() can return null at browser launch time.
+ var tabBrowser = getTabBrowser(win);
+ if ( tabBrowser === null ) {
+ return null;
+ }
return browserFromTarget(getTabBrowser(win).selectedTab);
};