Fixed crash when the date for a history item could possibly be formatted as null.
This commit is contained in:
parent
e44743fbae
commit
9ebac37394
@ -366,7 +366,11 @@ static MGMController *MGMSharedController;
|
||||
NSMenuItem *item = [[NSMenuItem new] autorelease];
|
||||
NSDateFormatter *formatter = [[NSDateFormatter new] autorelease];
|
||||
[formatter setDateFormat:@"MMMM d, yyyy h:mm:ss a"];
|
||||
[item setTitle:[formatter stringFromDate:[historyItem objectForKey:MGMHDate]]];
|
||||
NSString *date = [formatter stringFromDate:[historyItem objectForKey:MGMHDate]];
|
||||
if (date!=nil)
|
||||
[item setTitle:date];
|
||||
else
|
||||
[item setTitle:[NSString stringWithFormat:@"%@", [historyItem objectForKey:MGMHDate]]];
|
||||
[item setRepresentedObject:[historyItem objectForKey:MGMHURL]];
|
||||
[item setTarget:self];
|
||||
[item setAction:@selector(copyHistoryItem:)];
|
||||
|
Loading…
Reference in New Issue
Block a user