mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
src: improve error handling in tty_wrap.cc
PR-URL: https://github.com/nodejs/node/pull/57211 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
1 parent
f845ad953e
commit
96b2bfb88c
1 file changed
+6
-2
+6
-2
@@ -100,8 +100,12 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
if (err == 0) {
|
||||
Local<Array> a = args[0].As<Array>();
|
||||
a->Set(env->context(), 0, Integer::New(env->isolate(), width)).Check();
|
||||
a->Set(env->context(), 1, Integer::New(env->isolate(), height)).Check();
|
||||
if (a->Set(env->context(), 0, Integer::New(env->isolate(), width))
|
||||
.IsNothing() ||
|
||||
a->Set(env->context(), 1, Integer::New(env->isolate(), height))
|
||||
.IsNothing()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
args.GetReturnValue().Set(err);
|
||||
|
||||
Reference in new issue
Block a user