Don't crash if a menu contains no submenus.

This commit is contained in:
Alexander Langer 2001-09-28 13:45:27 +00:00
parent 98c35cf31e
commit 12a94fc568
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=48244
2 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= tvision
PORTVERSION= 0.7
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_SUNSITE}
MASTER_SITE_SUBDIR= devel/lang/c++

View File

@ -0,0 +1,11 @@
--- lib/TMenuView.cc.old Fri Sep 28 15:40:42 2001
+++ lib/TMenuView.cc Fri Sep 28 15:41:40 2001
@@ -470,7 +470,7 @@
if( p->command == 0 )
{
TMenuItem *T;
- if( (T = findHotKey( p->subMenu->items, keyCode )) != 0 )
+ if( p->subMenu != 0 && (T = findHotKey( p->subMenu->items, keyCode )) != 0 )
return T;
}
else if( !p->disabled &&