Skip to content

Commit

Permalink
Check if JSON is string is empty (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
GLinnik21 authored Sep 5, 2024
1 parent 90371f4 commit 78687d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/KSCrashRecording/KSCrash.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ - (instancetype)init
- (NSDictionary *)userInfo
{
const char *userInfoJSON = kscrash_getUserInfoJSON();
if (userInfoJSON != NULL) {
if (userInfoJSON != NULL && strlen(userInfoJSON) > 0) {
NSError *error = nil;
NSData *jsonData = [NSData dataWithBytes:userInfoJSON length:strlen(userInfoJSON)];
NSDictionary *userInfoDict = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error];
Expand Down

0 comments on commit 78687d5

Please sign in to comment.