summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMenu.c
diff options
context:
space:
mode:
authordas <das@noemail.net>2008-12-07 16:30:08 (GMT)
committerdas <das@noemail.net>2008-12-07 16:30:08 (GMT)
commit90cbf72da68509e6e957fec9297f54a96f7695c8 (patch)
tree42037f4a84312834bd7b293399e4536e02b46d0b /macosx/tkMacOSXMenu.c
parent4a19c2056fbb4a8f52d71b6cb587a5f7340f0f34 (diff)
downloadtk-90cbf72da68509e6e957fec9297f54a96f7695c8.zip
tk-90cbf72da68509e6e957fec9297f54a96f7695c8.tar.gz
tk-90cbf72da68509e6e957fec9297f54a96f7695c8.tar.bz2
MenuDefProc: avoid crash with non-Tk menus
FossilOrigin-Name: 4695f9cf6753ebe6ed315813d5abdf0c890da390
Diffstat (limited to 'macosx/tkMacOSXMenu.c')
-rw-r--r--macosx/tkMacOSXMenu.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index fbaa033..366b222 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.46 2008/10/27 11:55:44 dkf Exp $
+ * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.47 2008/12/07 16:30:09 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -4121,12 +4121,8 @@ MenuDefProc(
menuID = GetMenuID(menu);
commandEntryPtr = Tcl_FindHashEntry(&commandTable, (char*)(intptr_t)menuID);
-
- if (commandEntryPtr) {
- menuPtr = Tcl_GetHashValue(commandEntryPtr);
- } else {
- menuPtr = NULL;
- }
+ if (!commandEntryPtr) return;
+ menuPtr = Tcl_GetHashValue(commandEntryPtr);
switch (message) {
case kMenuInitMsg: