mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Make sure not to check for store updates if NSLocaleCountryCode returns nil
And also make sure it doesn't crash in that case :)
This commit is contained in:
parent
77f1522b44
commit
c4921bb9de
@ -293,9 +293,16 @@
|
|||||||
if (self.countryCode) {
|
if (self.countryCode) {
|
||||||
country = [NSString stringWithFormat:@"&country=%@", self.countryCode];
|
country = [NSString stringWithFormat:@"&country=%@", self.countryCode];
|
||||||
} else {
|
} else {
|
||||||
|
// 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]];
|
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"];
|
NSString *appBundleIdentifier = [self.mainBundle objectForInfoDictionaryKey:@"CFBundleIdentifier"];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user