Fix crash bug 230380. Patch by isaachh@mailc.net (Isaac Hwak Han), r=bryner, sr=jst

This commit is contained in:
bzbarsky%mit.edu 2004-01-13 20:50:57 +00:00
Родитель ece372f07e
Коммит c4f4038c7d
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -1992,11 +1992,11 @@ nsEventListenerManager::FixContextMenuEvent(nsIPresContext* aPresContext,
nsCOMPtr<nsIDOMEventTarget> currentTarget(aCurrentTarget);
nsCOMPtr<nsIDOMElement> currentFocus;
nsCOMPtr<nsIDocument> doc;
nsCOMPtr<nsIPresShell> shell;
nsCOMPtr<nsIPresShell> shell = aPresContext->PresShell();
nsString empty;
if (aEvent->message == NS_CONTEXTMENU_KEY) {
aPresContext->PresShell()->GetDocument(getter_AddRefs(doc));
shell->GetDocument(getter_AddRefs(doc));
if (doc) {
nsCOMPtr<nsPIDOMWindow> privWindow = do_QueryInterface(doc->GetScriptGlobalObject());
if (privWindow) {