Bug 1277197 - fix JS error in PresentationRequestUIGlue for 2-UAs device. r=kuoe0.
authorShih-Chiang Chien <schien@mozilla.com>
Wed, 01 Jun 2016 21:12:21 +0800
changeset 340958 fced3739df6b02a0217fa11ca18e1563e39816d3
parent 340957 fd184690f95c861e5e492cae580756afdb554f09
child 340959 fa0c71f97aff115779e4a4ef0286c23578ec73f1
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskuoe0
bugs1277197
milestone49.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 1277197 - fix JS error in PresentationRequestUIGlue for 2-UAs device. r=kuoe0.
b2g/components/PresentationRequestUIGlue.js
--- a/b2g/components/PresentationRequestUIGlue.js
+++ b/b2g/components/PresentationRequestUIGlue.js
@@ -18,17 +18,21 @@ Cu.import("resource://gre/modules/Servic
 XPCOMUtils.defineLazyModuleGetter(this, "SystemAppProxy",
                                   "resource://gre/modules/SystemAppProxy.jsm");
 
 function PresentationRequestUIGlue() { }
 
 PresentationRequestUIGlue.prototype = {
 
   sendRequest: function(aUrl, aSessionId, aDevice) {
-    let localDevice = aDevice.QueryInterface(Ci.nsIPresentationLocalDevice);
+    let localDevice;
+    try {
+      localDevice = aDevice.QueryInterface(Ci.nsIPresentationLocalDevice);
+    } catch (e) {}
+
     if (localDevice) {
       return this.sendTo1UA(aUrl, aSessionId, localDevice.windowId);
     } else {
       return this.sendTo2UA(aUrl, aSessionId);
     }
   },
 
   // For 1-UA scenario