Bug 780123 - bustage fix for xpcshell test shutdown; r=me
authorTim Taubert <ttaubert@mozilla.com>
Wed, 19 Sep 2012 17:33:55 +0200
changeset 107484 47e7a44f9c9123cad29e0d63398ec08504e97071
parent 107483 43f5c824aa3dcd0f4633afb0370099495c004f66
child 107485 fc935d3901cd0ad8c2dc35d4932b6fcaa78b269c
push id23489
push userttaubert@mozilla.com
push dateThu, 20 Sep 2012 09:37:23 +0000
treeherderautoland@2208b83cc81d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs780123
milestone18.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 780123 - bustage fix for xpcshell test shutdown; r=me
browser/modules/BrowserNewTabPreloader.jsm
--- a/browser/modules/BrowserNewTabPreloader.jsm
+++ b/browser/modules/BrowserNewTabPreloader.jsm
@@ -62,18 +62,20 @@ let Preferences = {
   },
 
   init: function Preferences_init() {
     this._branch = Services.prefs.getBranch(PREF_BRANCH);
     this._branch.addObserver("", this, false);
   },
 
   uninit: function Preferences_uninit() {
-    this._branch.removeObserver("", this);
-    this._branch = null;
+    if (this._branch) {
+      this._branch.removeObserver("", this);
+      this._branch = null;
+    }
   },
 
   observe: function Preferences_observe(aSubject, aTopic, aData) {
     let {url, enabled} = this;
     this._url = this._enabled = null;
 
     if (enabled && !this.enabled) {
       HiddenBrowser.destroy();