Skip to content

Commit

Permalink
fix: runtime crashing during OnUncaughtError
Browse files Browse the repository at this point in the history
  • Loading branch information
Archez committed Jan 25, 2022
1 parent 1dea4c4 commit 723f488
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NativeScript/runtime/Runtime.mm
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@
if (AppPackageJson == nil) {
NSString* packageJsonPath = [[NSString stringWithUTF8String:RuntimeConfig.ApplicationPath.c_str()] stringByAppendingPathComponent:@"package.json"];
NSData* data = [NSData dataWithContentsOfFile:packageJsonPath];
AppPackageJson = @{};
if (data) {
NSError* error = nil;
AppPackageJson = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
NSDictionary* dict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
AppPackageJson = [[NSDictionary alloc] initWithDictionary:dict];
}
}

Expand Down

0 comments on commit 723f488

Please sign in to comment.