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 185d1ff

Browse filesBrowse files
jasnelladuh95
authored andcommitted
src: improve error handling in node_messaging.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 96b2bfb commit 185d1ff
Copy full SHA for 185d1ff

File tree

Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Open diff view settings
Collapse file

‎src/node_messaging.cc‎

Copy file name to clipboardExpand all lines: src/node_messaging.cc
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,10 +1627,15 @@ static void MessageChannel(const FunctionCallbackInfo<Value>& args) {
16271627

16281628
MessagePort::Entangle(port1, port2);
16291629

1630-
args.This()->Set(context, env->port1_string(), port1->object())
1631-
.Check();
1632-
args.This()->Set(context, env->port2_string(), port2->object())
1633-
.Check();
1630+
if (args.This()
1631+
->Set(context, env->port1_string(), port1->object())
1632+
.IsNothing() ||
1633+
args.This()
1634+
->Set(context, env->port2_string(), port2->object())
1635+
.IsNothing()) {
1636+
port1->Close();
1637+
port2->Close();
1638+
}
16341639
}
16351640

16361641
static void BroadcastChannel(const FunctionCallbackInfo<Value>& args) {

0 commit comments

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