diff --git a/ChangeLog b/ChangeLog index 1031edf9e..b94814a3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-11-20 Adam Fedor + + * Source/NSBundle.m (+preferredLocalizationsFromArray:forPreferences:): + Check for array with no objects. + ([NSBundle -localizedInfoDictionary]): Idem. + 2002-11-20 Richard Frith-Macdonald * Source/Additions/Unicode.m: Work around bug in the redhat 8 iconv diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 2e37a7420..34b55b43f 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -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