diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 2df760bea79f..dbf7d9d85466 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -5133,11 +5133,9 @@ NS_IMETHODIMP nsDocument::GetDefaultView(nsIDOMWindow** aDefaultView) { *aDefaultView = nsnull; - nsPIDOMWindow* win = GetWindow(); - if (!win) { - return NS_OK; - } - return CallQueryInterface(win, aDefaultView); + nsCOMPtr win = GetWindow(); + win.forget(aDefaultView); + return NS_OK; } NS_IMETHODIMP