diff options
author | das <das@noemail.net> | 2008-12-07 16:44:57 (GMT) |
---|---|---|
committer | das <das@noemail.net> | 2008-12-07 16:44:57 (GMT) |
commit | 4faf5155cd1d686974cf70dabade0b72fe8a5f96 (patch) | |
tree | c0b8580fbc728861e9f68a833ea1d3feff0465d9 /macosx/tkMacOSXMenu.c | |
parent | 2bb6d95d8f89d8329fcb51e35cfd500523d07b56 (diff) | |
download | tk-4faf5155cd1d686974cf70dabade0b72fe8a5f96.zip tk-4faf5155cd1d686974cf70dabade0b72fe8a5f96.tar.gz tk-4faf5155cd1d686974cf70dabade0b72fe8a5f96.tar.bz2 |
MenuDefProc: avoid crash with non-Tk menus
FossilOrigin-Name: 4d7c9cff90308fc46bbc42321bb135f11ebb7827
Diffstat (limited to 'macosx/tkMacOSXMenu.c')
-rw-r--r-- | macosx/tkMacOSXMenu.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 17880c4..d658dbf 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.6.2.30 2007/11/09 06:26:56 das Exp $ + * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.6.2.31 2008/12/07 16:44:58 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: |