Ignore CPMenu -itemChanged: when unarchiving menu items

This commit is contained in:
Aparajita Fishman committed 2013-02-11 11:07:37 -05:00
1 parent 9af2648b22
commit 43817779c5
1 file changed
+6 -1
+6 -1
View File
@@ -359,7 +359,12 @@ var _CPMenuBarVisible = NO,
*/
- (void)itemChanged:(CPMenuItem)aMenuItem
{
if ([aMenuItem menu] !== self)
/*
During cib unarchiving, menu items will have a reference to their menu,
but of course the items are still being unarchived and the menu's _items
have not yet been instantiated. In that case we will not do anything here.
*/
if ([aMenuItem menu] !== self || !_items)
return;
[aMenuItem setValue:[aMenuItem valueForKey:@"changeCount"] + 1 forKey:@"changeCount"];