diff --git a/ChangeLog b/ChangeLog index a52096295..f68cffaba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-11-13 Fred Kiefer + + * Source/NSImage.m (-bestRepresentationForDevice:): Fix last + change for the case where there are no representations for the image. + 2011-11-13 Fred Kiefer * Source/NSUserDefaultsController.m diff --git a/Source/NSImage.m b/Source/NSImage.m index 2f0529796..b56053103 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -1502,7 +1502,16 @@ static NSSize GSResolutionOfImageRep(NSImageRep *rep) } } } - return [reps objectAtIndex: 0]; + + + if ([reps count] > 0) + { + return [reps objectAtIndex: 0]; + } + else + { + return nil; + } } - (NSImageRep *) bestRepresentationForRect: (NSRect)rect