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 338945 fced3739df6b02a0217fa11ca18e1563e39816d3
parent 338944 fd184690f95c861e5e492cae580756afdb554f09
child 338946 fa0c71f97aff115779e4a4ef0286c23578ec73f1
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [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