Bug 587494: Check whether our ExternalResource has a viewer before calling Hide() on it, to fix null-crash. r=roc a=blocking
authorDaniel Holbert <dholbert@cs.stanford.edu>
Sun, 15 Aug 2010 15:49:21 -0700
changeset 50640 0074c4f2d5613fce33517662d8c1a95b1595e966
parent 50639 5e9c05dbe8d6a2165e0112cba51068abbc1a3b96
child 50641 420973cfb89d05d9f2529c2829890ba34c5ff1e0
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, blocking
bugs587494
milestone2.0b4pre
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 587494: Check whether our ExternalResource has a viewer before calling Hide() on it, to fix null-crash. r=roc a=blocking
content/base/src/nsDocument.cpp
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -821,17 +821,19 @@ nsExternalResourceMap::Traverse(nsCycleC
   mMap.EnumerateRead(ExternalResourceTraverser, aCallback);
 }
 
 static PLDHashOperator
 ExternalResourceHider(nsIURI* aKey,
                       nsExternalResourceMap::ExternalResource* aData,
                       void* aClosure)
 {
-  aData->mViewer->Hide();
+  if (aData->mViewer) {
+    aData->mViewer->Hide();
+  }
   return PL_DHASH_NEXT;
 }
 
 void
 nsExternalResourceMap::HideViewers()
 {
   mMap.EnumerateRead(ExternalResourceHider, nsnull);
 }