Bug 647951 - Fix for "window.top.XULBrowserWindow is null" error. r=mak
authorOHZEKI Tetsuharu <saneyuki.s.snyk@gmail.com>
Wed, 28 Mar 2012 20:35:13 +0200
changeset 93861 a313f75c607c1c15c743038ff18caa6c2393a90a
parent 93860 97377dc127550fe8c0a3dff0843d4de4bbb02ad6
child 93862 8e1f2165d52ec92e8d350ed66867c7fdff395a3f
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs647951
milestone14.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 647951 - Fix for "window.top.XULBrowserWindow is null" error. r=mak
browser/components/places/content/sidebarUtils.js
--- a/browser/components/places/content/sidebarUtils.js
+++ b/browser/components/places/content/sidebarUtils.js
@@ -131,11 +131,16 @@ var SidebarUtils = {
       else
         this.setMouseoverURL("");
     }
     else
       this.setMouseoverURL("");
   },
 
   setMouseoverURL: function SU_setMouseoverURL(aURL) {
-    window.top.XULBrowserWindow.setOverLink(aURL, null);
+    // When the browser window is closed with an open sidebar, the sidebar
+    // unload event happens after the browser's one.  In this case
+    // top.XULBrowserWindow has been nullified already.
+    if (top.XULBrowserWindow) {
+      top.XULBrowserWindow.setOverLink(aURL, null);
+    }
   }
 };