Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 96b2bfb

Browse filesBrowse files
jasnelladuh95
authored andcommitted
src: improve error handling in tty_wrap.cc
PR-URL: #57211 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent f845ad9 commit 96b2bfb
Copy full SHA for 96b2bfb

File tree

Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed
Open diff view settings
Collapse file

‎src/tty_wrap.cc‎

Copy file name to clipboardExpand all lines: src/tty_wrap.cc
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,12 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo<Value>& args) {
100100

101101
if (err == 0) {
102102
Local<Array> a = args[0].As<Array>();
103-
a->Set(env->context(), 0, Integer::New(env->isolate(), width)).Check();
104-
a->Set(env->context(), 1, Integer::New(env->isolate(), height)).Check();
103+
if (a->Set(env->context(), 0, Integer::New(env->isolate(), width))
104+
.IsNothing() ||
105+
a->Set(env->context(), 1, Integer::New(env->isolate(), height))
106+
.IsNothing()) {
107+
return;
108+
}
105109
}
106110

107111
args.GetReturnValue().Set(err);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.