File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -163,9 +163,11 @@ inline int StreamBase::Shutdown(v8::Local<v8::Object> req_wrap_obj) {
163
163
HandleScope handle_scope (env->isolate ());
164
164
165
165
if (req_wrap_obj.IsEmpty ()) {
166
- req_wrap_obj =
167
- env->shutdown_wrap_template ()
168
- ->NewInstance (env->context ()).ToLocalChecked ();
166
+ if (!env->shutdown_wrap_template ()
167
+ ->NewInstance (env->context ())
168
+ .ToLocal (&req_wrap_obj)) {
169
+ return UV_EBUSY;
170
+ }
169
171
StreamReq::ResetObject (req_wrap_obj);
170
172
}
171
173
@@ -211,9 +213,11 @@ inline StreamWriteResult StreamBase::Write(
211
213
HandleScope handle_scope (env->isolate ());
212
214
213
215
if (req_wrap_obj.IsEmpty ()) {
214
- req_wrap_obj =
215
- env->write_wrap_template ()
216
- ->NewInstance (env->context ()).ToLocalChecked ();
216
+ if (!env->write_wrap_template ()
217
+ ->NewInstance (env->context ())
218
+ .ToLocal (&req_wrap_obj)) {
219
+ return StreamWriteResult { false , UV_EBUSY, nullptr , 0 };
220
+ }
217
221
StreamReq::ResetObject (req_wrap_obj);
218
222
}
219
223
You can’t perform that action at this time.
0 commit comments