Bug 1279738 - Only provide dialog args for open if they exist. r=Ratty a=Ratty
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Fri, 17 Jun 2016 14:07:17 +0200
changeset 27284 f78998dd2482d6fb0ba8652e198af1b3f507a940
parent 27283 8892b33a201fad73672ed971ad285c9618d979fa
child 27285 d01a19c07ed3a79bd85b72160480e03b15509f05
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, Ratty
bugs1279738
Bug 1279738 - Only provide dialog args for open if they exist. r=Ratty a=Ratty
suite/common/tasksOverlay.js
--- a/suite/common/tasksOverlay.js
+++ b/suite/common/tasksOverlay.js
@@ -115,21 +115,30 @@ function toOpenWindowByType(inType, uri,
     // open the requested window, but block it until it's fully loaded
     function newWindowLoaded(event)
     {
       // make sure that this handler is called only once
       window.removeEventListener("unload", newWindowLoaded, false);
       window[uri].removeEventListener("load", newWindowLoaded, false);
       delete window[uri];
     }
-    // remember the newly loading window until it's fully loaded
-    // or until the current window passes away
-    window[uri] = openDialog(uri, "",
-                             features || "non-private,all,dialog=no",
-                             args || null);
+
+    // Remember the newly loading window until it's fully loaded
+    // or until the current window passes away.
+    // Only pass args if they exist and have a value (see Bug 1279738).
+    if (typeof args != "undefined" && args) {
+      window[uri] = openDialog(uri, "",
+                               features || "non-private,all,dialog=no",
+                               args || null);
+    }
+    else {
+      window[uri] = openDialog(uri, "",
+                               features || "non-private,all,dialog=no");
+    }
+
     window[uri].addEventListener("load", newWindowLoaded, false);
     window.addEventListener("unload", newWindowLoaded, false);
   }
   return;
 }
 
 function OpenBrowserWindow()
 {