зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1442938: Nil-check the title in nsCocoaWindow::importState / exportState. r=mstange
Looking at the docs for [NSWindow title] I don't think it's supposed to return nil under any circumstances... But it does in our automation, for some reason, with the patches for bug 1439875 which make our fullscreen code run a bit earlier. MozReview-Commit-ID: AX4qzjzsqST --HG-- extra : rebase_source : a01f2ba6b42b4067e7a4886c4814e85f317a4a6f
This commit is contained in:
Родитель
8f461abbfb
Коммит
b7cf65fe60
|
@ -3198,7 +3198,9 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior";
|
|||
|
||||
- (void)importState:(NSDictionary*)aState
|
||||
{
|
||||
[self setTitle:[aState objectForKey:kStateTitleKey]];
|
||||
if (NSString* title = [aState objectForKey:kStateTitleKey]) {
|
||||
[self setTitle:title];
|
||||
}
|
||||
[self setDrawsContentsIntoWindowFrame:[[aState objectForKey:kStateDrawsContentsIntoWindowFrameKey] boolValue]];
|
||||
[self setTitlebarColor:[aState objectForKey:kStateActiveTitlebarColorKey] forActiveWindow:YES];
|
||||
[self setTitlebarColor:[aState objectForKey:kStateInactiveTitlebarColorKey] forActiveWindow:NO];
|
||||
|
@ -3209,7 +3211,9 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior";
|
|||
- (NSMutableDictionary*)exportState
|
||||
{
|
||||
NSMutableDictionary* state = [NSMutableDictionary dictionaryWithCapacity:10];
|
||||
[state setObject:[self title] forKey:kStateTitleKey];
|
||||
if (NSString* title = [self title]) {
|
||||
[state setObject:title forKey:kStateTitleKey];
|
||||
}
|
||||
[state setObject:[NSNumber numberWithBool:[self drawsContentsIntoWindowFrame]]
|
||||
forKey:kStateDrawsContentsIntoWindowFrameKey];
|
||||
NSColor* activeTitlebarColor = [self titlebarColorForActiveWindow:YES];
|
||||
|
|
Загрузка…
Ссылка в новой задаче