From a1f5431951d70857662f6ff4edb0a72966a09c1c Mon Sep 17 00:00:00 2001 From: "pierre%netscape.com" Date: Wed, 16 Jun 1999 06:22:11 +0000 Subject: [PATCH] Fixed a crash in HandleMenuCommand(). It could especially happen on Quit. --- widget/src/mac/nsMacEventHandler.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/widget/src/mac/nsMacEventHandler.cpp b/widget/src/mac/nsMacEventHandler.cpp index fa6358450783..6bc1cd297c2b 100644 --- a/widget/src/mac/nsMacEventHandler.cpp +++ b/widget/src/mac/nsMacEventHandler.cpp @@ -169,6 +169,9 @@ PRBool nsMacEventHandler::HandleMenuCommand( if (toolkit) focusedWidget = toolkit->GetFocus(); + if (!focusedWidget) + return PR_FALSE; + // nsEvent nsMenuEvent menuEvent; menuEvent.eventStructType = NS_MENU_EVENT; @@ -1182,7 +1185,8 @@ PRBool nsMacEventHandler::HandleStartComposition(void) if (toolkit) focusedWidget = toolkit->GetFocus(); - if (!focusedWidget) return PR_FALSE; + if (!focusedWidget) + return PR_FALSE; // // create the nsCompositionEvent @@ -1219,7 +1223,8 @@ PRBool nsMacEventHandler::HandleEndComposition(void) if (toolkit) focusedWidget = toolkit->GetFocus(); - if (!focusedWidget) return PR_FALSE; + if (!focusedWidget) + return PR_FALSE; // // create the nsCompositionEvent @@ -1256,7 +1261,8 @@ PRBool nsMacEventHandler::HandleTextEvent(void) if (toolkit) focusedWidget = toolkit->GetFocus(); - if (!focusedWidget) return PR_FALSE; + if (!focusedWidget) + return PR_FALSE; // // create the nsCompositionEvent