diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index 13fce75329d..0e737b4a0d7 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -4550,7 +4550,7 @@ nsWindowSH::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, nsCOMPtr location; nsresult rv = window->GetLocation(getter_AddRefs(location)); - NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && location, rv); nsCOMPtr holder; rv = WrapNative(cx, obj, location, NS_GET_IID(nsIDOMLocation), vp,