From c387e7ad6eaacfe4b9176944d497cac5fee9367b Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Sun, 13 Nov 2011 19:24:17 +0000 Subject: [PATCH] * Source/NSImage.m (-bestRepresentationForDevice:): Fix last change for the case where there are no representations for the image. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34168 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSImage.m | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) 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