Bug 881601 - Don't close the listener if it was never opened, r=wlach
authorJonathan Griffin <jgriffin@mozilla.com>
Thu, 13 Jun 2013 10:04:48 -0700
changeset 146442 da56c7a59b9ee6abdea559157c9367b4de94660f
parent 146441 02fcadb6975b993b8b3a9e892ad78b0942c08efa
child 146443 84d0546e9816a11bf89cca4ebb5cd8c600924a4f
child 146447 5192a9233d8389e211305dac1d5496e67a222b54
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswlach
bugs881601
milestone24.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 881601 - Don't close the listener if it was never opened, r=wlach
testing/marionette/components/marionettecomponent.js
--- a/testing/marionette/components/marionettecomponent.js
+++ b/testing/marionette/components/marionettecomponent.js
@@ -53,16 +53,17 @@ MarionetteComponent.prototype = {
   classID: MARIONETTE_CID,
   contractID: MARIONETTE_CONTRACTID,
   QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler, Ci.nsIObserver]),
   _xpcom_categories: [{category: "command-line-handler", entry: "b-marionette"},
                       {category: "profile-after-change", service: true}],
   appName: Services.appinfo.name,
   enabled: false,
   finalUiStartup: false,
+  _marionetteServer: null,
 
   onSocketAccepted: function mc_onSocketAccepted(aSocket, aTransport) {
     this.logger.info("onSocketAccepted for Marionette dummy socket");
   },
 
   onStopListening: function mc_onStopListening(aSocket, status) {
     this.logger.info("onStopListening for Marionette dummy socket, code " + status);
     aSocket.close();
@@ -147,15 +148,17 @@ MarionetteComponent.prototype = {
       }
       catch(e) {
         this.logger.error('exception: ' + e.name + ', ' + e.message);
       }
     }
   },
 
   uninit: function mc_uninit() {
-    this._marionetteServer.closeListener();
+    if (this._marionetteServer) {
+      this._marionetteServer.closeListener();
+    }
     this._loaded = false;
   },
 
 };
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MarionetteComponent]);