Bug 1186346 - Add a null-check for content to avoid a JS error in tab-content.js when pages disappear quickly, r=gijs
authorGiovanny Andres Gongora Granada <gioyik@gmail.com>
Sun, 09 Aug 2015 20:20:00 +0100
changeset 257020 6bc3294250068461a9b75aa80be422beffc3622a
parent 257019 aac05e8ce3ec646d64cd2891257fd7ddedcfe168
child 257021 6509f5665152adbd8120b6801acafdf85f190e9f
push id14561
push usergijskruitbosch@gmail.com
push dateMon, 10 Aug 2015 08:27:23 +0000
treeherderfx-team@6bc329425006 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1186346
milestone42.0a1
Bug 1186346 - Add a null-check for content to avoid a JS error in tab-content.js when pages disappear quickly, r=gijs
browser/base/content/tab-content.js
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -281,16 +281,19 @@ let AboutReaderListener = {
 
       case "Reader:PushState":
         this.updateReaderButton(!!(message.data && message.data.isArticle));
         break;
     }
   },
 
   get isAboutReader() {
+    if (!content) {
+      return false;
+    }
     return content.document.documentURI.startsWith("about:reader");
   },
 
   handleEvent: function(aEvent) {
     if (aEvent.originalTarget.defaultView != content) {
       return;
     }