Skip to content

Commit 33d0ade

Browse files
Zach Eriksenjkasten2
authored andcommitted
If InnerJSON and Error exist, use them
1 parent c1d82e2 commit 33d0ade

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignalClient.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,9 @@ - (void)handleJSONNSURLResponse:(NSURLResponse*)response data:(NSData*)data erro
395395
successBlock(nil);
396396
}
397397
} else if (failureBlock != nil) {
398-
if (innerJson != nil && error == nil)
398+
if (innerJson != nil && error != nil)
399+
failureBlock([NSError errorWithDomain:@"OneSignalError" code:statusCode userInfo:@{@"returned" : innerJson, @"error": error}]);
400+
else if (innerJson != nil)
399401
failureBlock([NSError errorWithDomain:@"OneSignalError" code:statusCode userInfo:@{@"returned" : innerJson}]);
400402
else if (error != nil)
401403
failureBlock([NSError errorWithDomain:@"OneSignalError" code:statusCode userInfo:@{@"error" : error}]);

0 commit comments

Comments
 (0)