Skip to content

Commit

Permalink
Add missing trycatch (nodejs#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
verwaest authored Dec 1, 2023
1 parent 1948e7d commit 72cd9e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/js_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ void JSStream::Finish(const FunctionCallbackInfo<Value>& args) {


void JSStream::ReadBuffer(const FunctionCallbackInfo<Value>& args) {
v8::TryCatch try_catch(args.GetIsolate());
JSStream* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());

Expand All @@ -182,6 +183,7 @@ void JSStream::ReadBuffer(const FunctionCallbackInfo<Value>& args) {
len -= static_cast<int>(avail);
wrap->EmitRead(avail, buf);
}
if (try_catch.HasCaught()) try_catch.ReThrow();
}


Expand Down

0 comments on commit 72cd9e5

Please sign in to comment.