summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMenu.c
diff options
context:
space:
mode:
authordas <das>2008-12-07 16:44:49 (GMT)
committerdas <das>2008-12-07 16:44:49 (GMT)
commitffe006b69d0b87dbb1c6ee5378ef72c756175571 (patch)
tree812e6fc9e5ee12a775e0ec0736bc2637bd7011e8 /macosx/tkMacOSXMenu.c
parent79b9652e156a0e116812d2c5894bd7afef2d344e (diff)
downloadtk-ffe006b69d0b87dbb1c6ee5378ef72c756175571.zip
tk-ffe006b69d0b87dbb1c6ee5378ef72c756175571.tar.gz
tk-ffe006b69d0b87dbb1c6ee5378ef72c756175571.tar.bz2
MenuDefProc: avoid crash with non-Tk menus
Diffstat (limited to 'macosx/tkMacOSXMenu.c')
-rw-r--r--macosx/tkMacOSXMenu.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 98f7273..91b819f 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.45 2007/12/13 15:27:10 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.45.2.1 2008/12/07 16:44:49 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -4122,11 +4122,8 @@ MenuDefProc(
menuID = GetMenuID(menu);
commandEntryPtr = Tcl_FindHashEntry(&commandTable, (char*)(intptr_t)menuID);
- if (commandEntryPtr) {
- menuPtr = (TkMenu *) Tcl_GetHashValue(commandEntryPtr);
- } else {
- menuPtr = NULL;
- }
+ if (!commandEntryPtr) return;
+ menuPtr = (TkMenu *) Tcl_GetHashValue(commandEntryPtr);
switch (message) {
case kMenuInitMsg: