diff --git a/Classes/BITStoreUpdateManager.m b/Classes/BITStoreUpdateManager.m index afaddef2a6..f694fed702 100644 --- a/Classes/BITStoreUpdateManager.m +++ b/Classes/BITStoreUpdateManager.m @@ -293,9 +293,16 @@ if (self.countryCode) { country = [NSString stringWithFormat:@"&country=%@", self.countryCode]; } else { - country = [NSString stringWithFormat:@"&country=%@", [(NSDictionary *)self.currentLocale objectForKey: NSLocaleCountryCode]]; + // if the local is by any chance the systemLocale, it could happen that the NSLocaleCountryCode returns nil! + if ([(NSDictionary *)self.currentLocale objectForKey:NSLocaleCountryCode]) { + country = [NSString stringWithFormat:@"&country=%@", [(NSDictionary *)self.currentLocale objectForKey:NSLocaleCountryCode]]; + } else { + // don't check, just to be save + BITHockeyLog(@"ERROR: Locale returned nil, can't determine the language!"); + self.checkInProgress = NO; + return; + } } - // TODO: problem with worldwide is timed releases! NSString *appBundleIdentifier = [self.mainBundle objectForInfoDictionaryKey:@"CFBundleIdentifier"];