Dont crash app if a menu item does not have an action

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5440 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 1999-12-11 03:02:53 +00:00
parent 28fbc965b0
commit 982f1fda3c

View file

@ -689,9 +689,12 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
[nc postNotificationName: NSMenuWillSendActionNotification
object: self
userInfo: d];
[[NSApplication sharedApplication] sendAction: [item action]
to: [item target]
from: item];
if ([item action])
{
[[NSApplication sharedApplication] sendAction: [item action]
to: [item target]
from: item];
}
[nc postNotificationName: NSMenuDidSendActionNotification
object: self
userInfo: d];