diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index cad0d929a..f2c1220c0 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -1752,7 +1752,19 @@ - (id) initWithCoder: (NSCoder*)aDecoder } if ([aDecoder containsValueForKey: @"NSAlternateContents"]) { - [self setAlternateTitle: [aDecoder decodeObjectForKey: @"NSAlternateContents"]]; + id alternateContents = [aDecoder decodeObjectForKey: @"NSAlternateContents"]; + if ([alternateContents isKindOfClass:[NSString class]]) + { + [self setAlternateTitle:alternateContents]; + } + else if ([alternateContents isKindOfClass:[NSImage class]]) + { + [self setAlternateImage:alternateContents]; + } + else + { + NSLog(@"Invalid class for NSAlternateContents: %@", [alternateContents class]); + } } if ([aDecoder containsValueForKey: @"NSButtonFlags"]) {