Skip to content

Commit

Permalink
fix: use trycatch on error event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Bird committed Jan 25, 2022
1 parent 405df7f commit daeabad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions NativeScript/runtime/NativeScriptException.mm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@
Local<Object> thiz = Object::New(isolate);
Local<Value> args[] = { error };
Local<Value> result;
TryCatch tc(isolate);
success = errorHandlerFunc->Call(context, thiz, 1, args).ToLocal(&result);
if (tc.HasCaught()) {
tns::LogError(isolate, tc);
}

tns::Assert(success, isolate);
}

Expand Down

0 comments on commit daeabad

Please sign in to comment.