diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index 1d049c8a667..612daad9bab 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -2673,8 +2673,8 @@ nsXULDocument::LoadOverlay(const nsAString& aURL, nsIObserver* aObserver) } PRBool shouldReturn; rv = LoadOverlayInternal(uri, PR_TRUE, &shouldReturn); - if (NS_FAILED(rv)) - mOverlayLoadObservers.Remove(uri); // remove the observer if LoadOverlayInternal generated an error + if (NS_FAILED(rv) && mOverlayLoadObservers.IsInitialized()) + mOverlayLoadObservers.Remove(uri); // remove the observer if LoadOverlayInternal generated an error return rv; }