Skip to content

Commit

Permalink
dgram: revert SetSourceMembership arg parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Pardue committed Dec 1, 2017
1 parent 7083131 commit d52a81b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/udp_wrap.cc
Expand Up @@ -339,10 +339,11 @@ void UDPWrap::SetSourceMembership(const FunctionCallbackInfo<Value>& args,

node::Utf8Value source_address(args.GetIsolate(), args[0]);
node::Utf8Value group_address(args.GetIsolate(), args[1]);
node::Utf8Value iface(args.GetIsolate(), args[2]);

const char* iface_cstr = nullptr;
if (!args[2]->IsUndefined() && !args[2]->IsNull()) {
iface_cstr = *(node::Utf8Value(args.GetIsolate(), args[2]));
const char* iface_cstr = *iface;
if (args[1]->IsUndefined() || args[1]->IsNull()) {
iface_cstr = nullptr;
}

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

0 comments on commit d52a81b

Please sign in to comment.