Bug 941888 - Add null check to nsXULElement::GetWindowWidget(). r=mats
authorOlli Pettay <bugs@pettay.fi>
Fri, 22 Nov 2013 10:40:31 -0500
changeset 157069 e9e744a809df4d5349f9936aeaa4e412a61fa093
parent 157068 bd8942ec737bac42b73a5b6526bd0f13628fdf55
child 157070 2d8d46e3e15c9ed7cd2b615af9079a9b967190e4
push id25697
push userryanvm@gmail.com
push dateFri, 22 Nov 2013 20:18:23 +0000
treeherdermozilla-central@e9796b650e93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs941888
milestone28.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 941888 - Add null check to nsXULElement::GetWindowWidget(). r=mats
content/xul/content/src/nsXULElement.cpp
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -1774,17 +1774,17 @@ nsXULElement::HideWindowChrome(bool aSho
 }
 
 nsIWidget*
 nsXULElement::GetWindowWidget()
 {
     nsIDocument* doc = GetCurrentDoc();
 
     // only top level chrome documents can set the titlebar color
-    if (doc->IsRootDisplayDocument()) {
+    if (doc && doc->IsRootDisplayDocument()) {
         nsCOMPtr<nsISupports> container = doc->GetContainer();
         nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(container);
         if (baseWindow) {
             nsCOMPtr<nsIWidget> mainWidget;
             baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
             return mainWidget;
         }
     }