From 0f05850f0e2dab876785c1f923f4bdd6e44ba134 Mon Sep 17 00:00:00 2001 From: Rajesh Budhiraja Date: Wed, 17 Jan 2024 17:04:25 +0530 Subject: [PATCH] App was crashing due to out of bounds --- CleverTapSDK/CTDeviceInfo.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CleverTapSDK/CTDeviceInfo.m b/CleverTapSDK/CTDeviceInfo.m index 88c43c81..357df430 100644 --- a/CleverTapSDK/CTDeviceInfo.m +++ b/CleverTapSDK/CTDeviceInfo.m @@ -525,7 +525,7 @@ - (NSLocale *)systemLocale { if (!_systemLocale) { NSLocale *currentLocale = [NSLocale currentLocale]; - NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0]; + NSString *language = [[NSLocale preferredLanguages] firstObject]; if (!language || [language isEqualToString:@""] ){ language = @"xx"; }