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 90548 a313f75c607c1c15c743038ff18caa6c2393a90a
parent 90547 97377dc127550fe8c0a3dff0843d4de4bbb02ad6
child 90549 8e1f2165d52ec92e8d350ed66867c7fdff395a3f
push id22366
push usermak77@bonardo.net
push dateThu, 29 Mar 2012 15:38:30 +0000
treeherdermozilla-central@ff3521bc6559 [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);
+    }
   }
 };