mirror of https://github.com/grpc/grpc-node.git
Add type assertion on createSsl's fourth argument.
This commit is contained in:
parent
637f961706
commit
15c82e08c8
|
@ -189,7 +189,11 @@ NAN_METHOD(ChannelCredentials::CreateSsl) {
|
||||||
}
|
}
|
||||||
|
|
||||||
verify_peer_options verify_options = {NULL, NULL, NULL};
|
verify_peer_options verify_options = {NULL, NULL, NULL};
|
||||||
if (info.Length() >= 4 && info[3]->IsObject()) {
|
if (!info[3]->IsUndefined()) {
|
||||||
|
if (!info[3]->IsObject()) {
|
||||||
|
return Nan::ThrowTypeError("createSsl's fourth argument must be an "
|
||||||
|
"object");
|
||||||
|
}
|
||||||
Local<Context> context = Nan::New<Context>();
|
Local<Context> context = Nan::New<Context>();
|
||||||
Local<Object> object = info[3]->ToObject();
|
Local<Object> object = info[3]->ToObject();
|
||||||
MaybeLocal<Array> maybe_props = object->GetOwnPropertyNames(context);
|
MaybeLocal<Array> maybe_props = object->GetOwnPropertyNames(context);
|
||||||
|
|
Loading…
Reference in New Issue