Bug 967021: Check that a window listener is not null in marionette; r=mdas
authorDavid Burns <dburns@mozilla.com>
Thu, 17 Apr 2014 21:14:09 +0100
changeset 179489 ce8248d046d1fc53011e3fe63ebc0c2e9fb2d6e3
parent 179488 656d5a4f110ea7c58c2aa4bcbeec10d91615e9f2
child 179490 f323de6b918607114ab259bce6fb0d717b84cbed
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersmdas
bugs967021
milestone31.0a1
Bug 967021: Check that a window listener is not null in marionette; r=mdas
testing/marionette/marionette-server.js
--- a/testing/marionette/marionette-server.js
+++ b/testing/marionette/marionette-server.js
@@ -2370,18 +2370,19 @@ MarionetteServerConnection.prototype = {
       case "Marionette:register":
         // This code processes the content listener's registration information
         // and either accepts the listener, or ignores it
         let nullPrevious = (this.curBrowser.curFrameId == null);
         let listenerWindow =
                             Services.wm.getOuterWindowWithId(message.json.value);
 
         //go in here if we're already in a remote frame.
-        if ((!listenerWindow || listenerWindow.location.href != message.json.href) &&
-            (this.curBrowser.frameManager.currentRemoteFrame !== null)) {
+        if ((!listenerWindow || (listenerWindow.location &&
+                                listenerWindow.location.href != message.json.href)) &&
+                (this.curBrowser.frameManager.currentRemoteFrame !== null)) {
           // The outerWindowID from an OOP frame will not be meaningful to
           // the parent process here, since each process maintains its own
           // independent window list.  So, it will either be null (!listenerWindow)
           // if we're already in a remote frame,
           // or it will point to some random window, which will hopefully
           // cause an href mismatch.  Currently this only happens
           // in B2G for OOP frames registered in Marionette:switchToFrame, so
           // we'll acknowledge the switchToFrame message here.