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 257117 6bc3294250068461a9b75aa80be422beffc3622a
parent 257116 aac05e8ce3ec646d64cd2891257fd7ddedcfe168
child 257118 6509f5665152adbd8120b6801acafdf85f190e9f
push id63526
push userkwierso@gmail.com
push dateMon, 10 Aug 2015 22:02:03 +0000
treeherdermozilla-inbound@c4ab17503c09 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1186346
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;
     }