зеркало из https://github.com/mozilla/gecko-dev.git
Bug 433328: properly handle null inner window, patch by Blake Kaplan <mrbkap@gmail.com>, r+sr=jst, a=shaver
This commit is contained in:
Родитель
d2767b2d98
Коммит
b1f1aa6313
|
@ -537,8 +537,12 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest,
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsIScriptGlobalObject *globalObject = mDocument->GetScriptGlobalObject();
|
||||
NS_ENSURE_TRUE(globalObject, NS_ERROR_FAILURE);
|
||||
nsPIDOMWindow *pwin = mDocument->GetInnerWindow();
|
||||
if (!pwin || !pwin->IsInnerWindow()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsCOMPtr<nsIScriptGlobalObject> globalObject = do_QueryInterface(pwin);
|
||||
NS_ASSERTION(globalObject, "windows must be global objects");
|
||||
|
||||
// Get the script-type to be used by this element.
|
||||
nsCOMPtr<nsIContent> scriptContent(do_QueryInterface(aRequest->mElement));
|
||||
|
|
Загрузка…
Ссылка в новой задаче