From f97397b67c639ee21c32363864b584f20dfa8ce2 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Fri, 18 Feb 2000 10:22:20 +0000 Subject: [PATCH] Adding guards. Harmless. --- layout/xul/base/src/nsMenuPopupFrame.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layout/xul/base/src/nsMenuPopupFrame.cpp b/layout/xul/base/src/nsMenuPopupFrame.cpp index 258012d723a3..1c8c5fe0f49b 100644 --- a/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -914,6 +914,9 @@ nsMenuPopupFrame::CreateDismissalListener() NS_IMETHODIMP nsMenuPopupFrame::InstallKeyboardNavigator() { + if (mKeyboardNavigator) + return NS_OK; + nsCOMPtr doc; mContent->GetDocument(*getter_AddRefs(doc)); nsCOMPtr target = do_QueryInterface(doc); @@ -932,6 +935,9 @@ nsMenuPopupFrame::InstallKeyboardNavigator() NS_IMETHODIMP nsMenuPopupFrame::RemoveKeyboardNavigator() { + if (!mKeyboardNavigator) + return NS_OK; + mTarget->RemoveEventListener("keypress", (nsIDOMKeyListener*)mKeyboardNavigator, PR_TRUE); mTarget->RemoveEventListener("keydown", (nsIDOMKeyListener*)mKeyboardNavigator, PR_TRUE); mTarget->RemoveEventListener("keyup", (nsIDOMKeyListener*)mKeyboardNavigator, PR_TRUE);