chore: return when electron::SerializeV8Value fails

This commit is contained in:
Shelley Vohr
2024-06-07 16:25:55 +02:00
parent 25ed286706
commit b285b4f050

View File

@@ -76,8 +76,11 @@ void MessagePort::PostMessage(gin::Arguments* args) {
return;
}
electron::SerializeV8Value(args->isolate(), message_value,
&transferable_message);
if (!electron::SerializeV8Value(args->isolate(), message_value,
&transferable_message)) {
// SerializeV8Value sets an exception.
return;
}
v8::Local<v8::Value> transferables;
std::vector<gin::Handle<MessagePort>> wrapped_ports;