Bug 1078665: Ignore exceptions thrown out of getBrowserForDocument. r=zombie
authorDave Townsend <dtownsend@oxymoronical.com>
Mon, 06 Oct 2014 13:56:58 -0700
changeset 232283 5578b160f514fcbfb782c980fee483fa6e410c95
parent 232282 421486270287878ecc350a94d9ff4d29b6798fea
child 232284 b1b103778f93ebea31c13d725232775d48c76418
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszombie
bugs1078665
milestone35.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 1078665: Ignore exceptions thrown out of getBrowserForDocument. r=zombie
addon-sdk/source/lib/sdk/panel/window.js
--- a/addon-sdk/source/lib/sdk/panel/window.js
+++ b/addon-sdk/source/lib/sdk/panel/window.js
@@ -30,20 +30,24 @@ function getWindow(anchor) {
     for (let enumWindow of windows) {
       // Check if the anchor is in this browser window.
       if (enumWindow == anchorWindow) {
         window = anchorWindow;
         break;
       }
 
       // Check if the anchor is in a browser tab in this browser window.
-      let browser = enumWindow.gBrowser.getBrowserForDocument(anchorDocument);
-      if (browser) {
-        window = enumWindow;
-        break;
+      try {
+        let browser = enumWindow.gBrowser.getBrowserForDocument(anchorDocument);
+        if (browser) {
+          window = enumWindow;
+          break;
+        }
+      }
+      catch (e) {
       }
 
       // Look in other subdocuments (sidebar, etc.)?
     }
   }
 
   // If we didn't find the anchor's window (or we have no anchor),
   // return the most recent browser window.