Skip to content

Commit 0dcaf09

Browse files
authored
Address possibly nil country codes (#3975)
* Address possibly nil country codes * Update CHANGELOG
1 parent 4c4ba12 commit 0dcaf09

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

GoogleDataTransportCCTSupport/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- Updates GDT dependency to improve backgrounding logic.
33
- Reduces requests for background task creation. (#3893)
44
- Fix unbalanced background task creation in GDTCCTUploader. (#3838)
5+
- Fixes a nil argument being passed to GDTCCTEncodeString. (#3893)
56

67
# v1.1.0
78
- Updates GDT dependency to GDTCOR prefixed version.

GoogleDataTransportCCTSupport/GDTCCTLibrary/GDTCCTNanopbHelpers.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ gdt_cct_IosClientInfo GDTCCTConstructiOSClientInfo() {
162162
if (version) {
163163
iOSClientInfo.application_build = GDTCCTEncodeString(version);
164164
}
165-
iOSClientInfo.country = GDTCCTEncodeString([locale objectForKey:NSLocaleCountryCode]);
165+
NSString *countryCode = [locale objectForKey:NSLocaleCountryCode];
166+
if (countryCode) {
167+
iOSClientInfo.country = GDTCCTEncodeString([locale objectForKey:NSLocaleCountryCode]);
168+
}
166169
iOSClientInfo.model = GDTCCTEncodeString(device.model);
167170
NSString *languageCode = bundle.preferredLocalizations.firstObject;
168171
iOSClientInfo.language_code =

0 commit comments

Comments
 (0)