diff --git a/src/node_messaging.cc b/src/node_messaging.cc index 20e0c7673b8fa9..bb7344503e72c5 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -483,14 +483,14 @@ MessagePort* MessagePort::New( Local ctor; if (!GetMessagePortConstructor(env, context).ToLocal(&ctor)) return nullptr; - MessagePort* port = nullptr; // Construct a new instance, then assign the listener instance and possibly // the MessagePortData to it. Local instance; if (!ctor->NewInstance(context).ToLocal(&instance)) return nullptr; - ASSIGN_OR_RETURN_UNWRAP(&port, instance, nullptr); + MessagePort* port = Unwrap(instance); + CHECK_NOT_NULL(port); if (data) { port->Detach(); port->data_ = std::move(data);