Skip to content

Commit

Permalink
Merge pull request #1518 from OneSignal/fix/NSInvalidArgument-Exception
Browse files Browse the repository at this point in the history
Fix: Prevent crash with nil HTTPResponse headers
  • Loading branch information
jennantilla authored Nov 21, 2024
2 parents cb1502e + b8d6dcf commit 73ae2ef
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ - (void)handleJSONNSURLResponse:(NSURLResponse*)response data:(NSData*)data erro

NSHTTPURLResponse* HTTPResponse = (NSHTTPURLResponse*)response;
NSInteger statusCode = [HTTPResponse statusCode];
NSDictionary *headers = [HTTPResponse allHeaderFields];
NSDictionary *headers = [HTTPResponse allHeaderFields] ?: @{};
NSError* jsonError = nil;
NSMutableDictionary* innerJson;

Expand Down

0 comments on commit 73ae2ef

Please sign in to comment.