From fc0f4a3bff709e69f499ed0a07b30bfde4bec6d1 Mon Sep 17 00:00:00 2001 From: "heikki%netscape.com" Date: Tue, 25 Sep 2001 22:16:41 +0000 Subject: [PATCH] Bug 95489, attempting to fix this topcrash with a null-check. r=harishd, sr=vidur. --- content/base/src/nsScriptLoader.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index 5b05ebe053fb..2aa9e54f8115 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -535,6 +535,11 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest, { nsresult rv = NS_OK; + // We need a document to evaluate scripts. + if (!mDocument) { + return NS_ERROR_FAILURE; + } + nsCOMPtr globalObject; mDocument->GetScriptGlobalObject(getter_AddRefs(globalObject)); NS_ENSURE_TRUE(globalObject, NS_ERROR_FAILURE);