Skip to content

Commit

Permalink
Check iface against nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Oct 16, 2019
1 parent f271357 commit 4392ebf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/udp_wrap.cc
Expand Up @@ -414,9 +414,10 @@ void UDPWrap::SetSourceMembership(const FunctionCallbackInfo<Value>& args,
node::Utf8Value group_address(args.GetIsolate(), args[1]);
node::Utf8Value iface(args.GetIsolate(), args[2]);

if (*iface == nullptr) return;
const char* iface_cstr = *iface;
if (args[2]->IsUndefined() || args[2]->IsNull()) {
iface_cstr = nullptr;
iface_cstr = nullptr;
}

int err = uv_udp_set_source_membership(&wrap->handle_,
Expand Down

0 comments on commit 4392ebf

Please sign in to comment.