Bug 744992 - Do not go into the preview code if it is null. r=benb,jmathies a=lsblakk
authorMichael Kaply <mozilla@kaply.com>
Thu, 03 May 2012 18:07:07 -0400
changeset 95621 e1551b8eb23c2544384d72b6ecc65fa54a53d86d
parent 95620 445db7a929dce0d7b0905578b2cae932064b1fb8
child 95622 99726be033d0aa6f31a63546a46702ef8dc527e6
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)
reviewersbenb, jmathies, lsblakk
bugs744992
milestone14.0a2
Bug 744992 - Do not go into the preview code if it is null. r=benb,jmathies a=lsblakk
widget/windows/TaskbarPreview.cpp
--- a/widget/windows/TaskbarPreview.cpp
+++ b/widget/windows/TaskbarPreview.cpp
@@ -444,22 +444,22 @@ TaskbarPreview::MainWindowHook(void *aCo
                "Window hook proc called with wrong message");
   TaskbarPreview *preview = reinterpret_cast<TaskbarPreview*>(aContext);
   if (nMsg == WM_DESTROY) {
     // nsWindow is being destroyed
     // We can't really do anything at this point including removing hooks
     preview->mWnd = NULL;
   } else {
     nsWindow *window = WinUtils::GetNSWindowPtr(preview->mWnd);
-    NS_ASSERTION(window, "Cannot use taskbar previews in an embedded context!");
+    if (window) {
+      window->SetHasTaskbarIconBeenCreated();
 
-    window->SetHasTaskbarIconBeenCreated();
-
-    if (preview->mVisible)
-      preview->UpdateTaskbarProperties();
+      if (preview->mVisible)
+        preview->UpdateTaskbarProperties();
+    }
   }
   return false;
 }
 
 TaskbarPreview *
 TaskbarPreview::sActivePreview = nsnull;
 
 } // namespace widget