Bug 1218129: Added instanceof check before call to QueryInterface r=margaret
authorvivek <vivekb.balakrishnan@gmail.com>
Mon, 26 Oct 2015 19:40:39 +0200
changeset 304762 81d08a1039202a9966009ea282dea10a69bf68d2
parent 304761 b404b452db2bbc78f132e5d265c18441ec137b9a
child 304763 15acf2adefd0b290084399db1f4b2256cedcae62
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1218129
milestone44.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 1218129: Added instanceof check before call to QueryInterface r=margaret Thanks for that trick @mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -5855,18 +5855,18 @@ var XPInstallObserver = {
     Services.obs.addObserver(this, "xpi-signature-changed", false);
     Services.obs.addObserver(this, "browser-delayed-startup-finished", false);
 
     AddonManager.addInstallListener(this);
   },
 
   observe: function(aSubject, aTopic, aData) {
     let installInfo, tab, host;
-    if (aSubject) {
-      installInfo = aSubject.QueryInterface(Ci.amIWebInstallInfo);
+    if (aSubject && aSubject instanceof Ci.amIWebInstallInfo) {
+      installInfo = aSubject;
       tab = BrowserApp.getTabForBrowser(installInfo.browser);
       if (installInfo.originatingURI) {
         host = installInfo.originatingURI.host;
       }
     }
 
     let strings = Strings.browser;
     let brandShortName = Strings.brand.GetStringFromName("brandShortName");