Bug 933984 - Fix "this._mutationObserver is undefined" error on new tab page. r=gavin
authorDrew Willcoxon <adw@mozilla.com>
Mon, 04 Nov 2013 22:32:33 -0800
changeset 153590 0325da4d4bbce5fa225ed9d9f908d2b2e09a9600
parent 153589 a0d5fe789379bcbed75fefbe26b722b25bd0c945
child 153591 64e809f87e60868a26a362bd93f2c21a3fb8c957
push id25595
push userryanvm@gmail.com
push dateTue, 05 Nov 2013 20:19:27 +0000
treeherdermozilla-central@2ada3a06d5e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs933984
milestone28.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 933984 - Fix "this._mutationObserver is undefined" error on new tab page. r=gavin
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();