Bug 819588. Null-check the window before jumping. r=emk
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 11 Dec 2012 17:43:22 -0500
changeset 121287 5ed9e56c7a5d415f4445c00b89a01fba8cb1a6bd
parent 121286 939a0ad6e8d6453f0ebc86ea7b136a6bd01ede9c
child 121288 7a5e83065d9f20209a702ab857662818ae50d049
push idunknown
push userunknown
push dateunknown
reviewersemk
bugs819588
milestone20.0a1
Bug 819588. Null-check the window before jumping. r=emk
content/base/src/nsDOMParser.cpp
--- a/content/base/src/nsDOMParser.cpp
+++ b/content/base/src/nsDOMParser.cpp
@@ -415,17 +415,17 @@ nsDOMParser::InitInternal(nsISupports* a
     // Does that matter?
 
     // Also note that |cx| matches what GetDocumentFromContext() would return,
     // while GetDocumentFromCaller() gives us the window that the DOMParser()
     // call was made on.
 
     nsCOMPtr<nsIDocument> doc;
     nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aOwner);
-    if (aOwner) {
+    if (window) {
       nsCOMPtr<nsIDOMDocument> domdoc = window->GetExtantDocument();
       doc = do_QueryInterface(domdoc);
     }
 
     if (!doc) {
       return NS_ERROR_UNEXPECTED;
     }