Bug 933984 - Fix "this._mutationObserver is undefined" error on new tab page. r=gavin, a=bajaj
authorDrew Willcoxon <adw@mozilla.com>
Mon, 04 Nov 2013 22:32:33 -0800
changeset 161224 e3c81d8f02d30491e6ec35766230e4d1f953a4d7
parent 161223 f1ff35bd4efc86dd74e6b41c4302d96e10d6c874
child 161225 9b4b4c1b6dfe6ecfc00ec126dc28b99e2550dcf3
push id4569
push userryanvm@gmail.com
push dateWed, 06 Nov 2013 14:34:00 +0000
treeherdermozilla-aurora@924d4a7b26d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin, bajaj
bugs933984
milestone27.0a2
Bug 933984 - Fix "this._mutationObserver is undefined" error on new tab page. r=gavin, a=bajaj
browser/base/content/newtab/page.js
--- a/browser/base/content/newtab/page.js
+++ b/browser/base/content/newtab/page.js
@@ -141,17 +141,18 @@ let gPage = {
   },
 
   /**
    * Handles all page events.
    */
   handleEvent: function Page_handleEvent(aEvent) {
     switch (aEvent.type) {
       case "unload":
-        this._mutationObserver.disconnect();
+        if (this._mutationObserver)
+          this._mutationObserver.disconnect();
         gAllPages.unregister(this);
         break;
       case "click":
         gAllPages.enabled = !gAllPages.enabled;
         break;
       case "dragover":
         if (gDrag.isValid(aEvent) && gDrag.draggedSite)
           aEvent.preventDefault();