Skip to content

Commit

Permalink
Fix of NSInvalidArgumentException while trying to parse nil as Json (
Browse files Browse the repository at this point in the history
  • Loading branch information
SpertsyanKM authored Jan 9, 2023
1 parent 085e97b commit 62c62f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Runtime/iOS/Plugins/Common/UtilityBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ + (void)handleErrorResponse:(SandwichError *)error toMethod:(NSString *)methodNa
}

+ (const char *)jsonStringFromObject:(NSObject *)objectToConvert{
if (objectToConvert == nil) {
return nil;
}

NSError *error = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:objectToConvert options:0 error:&error];

Expand Down

0 comments on commit 62c62f6

Please sign in to comment.