diff --git a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index a98b388ba56c..ef11e6fbe459 100644 --- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -582,6 +582,8 @@ nsWindowWatcher::OpenWindowJSInternal(nsIDOMWindow *aParent, nsCOMPtr sm(do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID)); + NS_ENSURE_TRUE(sm, NS_ERROR_FAILURE); + // Remember who's calling us. This code used to assume a null // subject principal if it failed to get the principal, but that's // just not safe, so bail on errors here.