Skip to content

Commit 72cd9e5

Browse files
authored
Add missing trycatch (nodejs#171)
1 parent 1948e7d commit 72cd9e5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/js_stream.cc

+2
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ void JSStream::Finish(const FunctionCallbackInfo<Value>& args) {
162162

163163

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

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

187189

0 commit comments

Comments
 (0)