Skip to content

Commit 73ae2ef

Browse files
authored
Merge pull request #1518 from OneSignal/fix/NSInvalidArgument-Exception
Fix: Prevent crash with nil HTTPResponse headers
2 parents cb1502e + b8d6dcf commit 73ae2ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

iOS_SDK/OneSignalSDK/OneSignalCore/Source/API/OneSignalClient.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ - (void)handleJSONNSURLResponse:(NSURLResponse*)response data:(NSData*)data erro
197197

198198
NSHTTPURLResponse* HTTPResponse = (NSHTTPURLResponse*)response;
199199
NSInteger statusCode = [HTTPResponse statusCode];
200-
NSDictionary *headers = [HTTPResponse allHeaderFields];
200+
NSDictionary *headers = [HTTPResponse allHeaderFields] ?: @{};
201201
NSError* jsonError = nil;
202202
NSMutableDictionary* innerJson;
203203

0 commit comments

Comments
 (0)