Bug 780123 - bustage fix for xpcshell test shutdown; r=me
authorTim Taubert <ttaubert@mozilla.com>
Wed, 19 Sep 2012 17:33:55 +0200
changeset 107359 47e7a44f9c91
parent 107358 43f5c824aa3d
child 107360 fc935d3901cd
push id1095
push userttaubert@mozilla.com
push date2012-09-19 15:34 +0000
treeherderfx-team@47e7a44f9c91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs780123
milestone18.0a1
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();