Skip to content

Commit 27ca526

Browse files
committed
dns: fixed compilation warning
1 parent cbdc32c commit 27ca526

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cares_wrap.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,10 @@ void GetAddrInfo(const FunctionCallbackInfo<Value>& args) {
16011601
}
16021602

16031603
Local<Uint32> order;
1604-
args[4]->ToUint32(env->context()).ToLocal(&order);
1604+
if (!args[4]->ToUint32(env->context()).ToLocal(&order)) {
1605+
THROW_ERR_INVALID_ARG_VALUE(env, "bad order");
1606+
return;
1607+
}
16051608

16061609
auto req_wrap = std::make_unique<GetAddrInfoReqWrap>(env,
16071610
req_wrap_obj,

0 commit comments

Comments
 (0)