mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 05:10:57 +00:00
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:
parent
28fbc965b0
commit
982f1fda3c
1 changed files with 6 additions and 3 deletions
|
@ -689,9 +689,12 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
|
||||||
[nc postNotificationName: NSMenuWillSendActionNotification
|
[nc postNotificationName: NSMenuWillSendActionNotification
|
||||||
object: self
|
object: self
|
||||||
userInfo: d];
|
userInfo: d];
|
||||||
|
if ([item action])
|
||||||
|
{
|
||||||
[[NSApplication sharedApplication] sendAction: [item action]
|
[[NSApplication sharedApplication] sendAction: [item action]
|
||||||
to: [item target]
|
to: [item target]
|
||||||
from: item];
|
from: item];
|
||||||
|
}
|
||||||
[nc postNotificationName: NSMenuDidSendActionNotification
|
[nc postNotificationName: NSMenuDidSendActionNotification
|
||||||
object: self
|
object: self
|
||||||
userInfo: d];
|
userInfo: d];
|
||||||
|
|
Loading…
Reference in a new issue