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:
James M Snell authored and Antoine du Hamel committed 2025-03-09 10:58:32 +01:00
1 parent f845ad953e
commit 96b2bfb88c
1 file changed
+6 -2
+6 -2
View File
@@ -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);