check that the array of reps is populated, not just non-nil

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33786 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2011-08-25 15:20:45 +00:00
parent e14b034d8d
commit 4e0e32caac
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2011-08-25 Riccardo Mottola <rm@gnu.org>
* Source/NSImage.m ( _loadFromFile):
Check that the array of reps is populated, not just non-nil.
2011-08-20 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSImage.m (-setSize:): Don't invalidate the cache anymore,

View file

@ -1891,10 +1891,10 @@ iterate_reps_for_types(NSArray* imageReps, SEL method)
NSArray *array;
array = [NSImageRep imageRepsWithContentsOfFile: fileName];
if (array)
if (array || ([array count] > 0))
[self addRepresentations: array];
return (array) ? YES : NO;
return (array || ([array count] > 0)) ? YES : NO;
}
- (BOOL) _useFromFile: (NSString *)fileName