mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Check for array with no objects
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15032 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4d44332b79
commit
8fb4fc795d
2 changed files with 13 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
2002-11-20 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Source/NSBundle.m (+preferredLocalizationsFromArray:forPreferences:):
|
||||
Check for array with no objects.
|
||||
([NSBundle -localizedInfoDictionary]): Idem.
|
||||
|
||||
2002-11-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/Unicode.m: Work around bug in the redhat 8 iconv
|
||||
|
|
|
@ -1319,18 +1319,21 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
|||
[array addObject: locale];
|
||||
}
|
||||
/* I guess this is arbitrary if we can't find a match? */
|
||||
if ([array count] == 0)
|
||||
if ([array count] == 0 && [localizationsArray count] > 0)
|
||||
[array addObject: [localizationsArray objectAtIndex: 0]];
|
||||
return [array makeImmutableCopyOnFail: NO];
|
||||
}
|
||||
|
||||
- (NSDictionary *)localizedInfoDictionary
|
||||
{
|
||||
NSString* path;
|
||||
NSString* locale;
|
||||
NSString *path;
|
||||
NSArray *locales;
|
||||
NSString *locale = nil;
|
||||
NSDictionary *dict = nil;
|
||||
|
||||
locale = [[self preferredLocalizations] objectAtIndex: 0];
|
||||
locales = [self preferredLocalizations];
|
||||
if ([locales count] > 0)
|
||||
locale = [locales objectAtIndex: 0];
|
||||
path = [self pathForResource: @"Info-gnustep"
|
||||
ofType: @"plist"
|
||||
inDirectory: nil
|
||||
|
|
Loading…
Reference in a new issue