aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/node/ext/channel_credentials.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node/ext/channel_credentials.cc b/src/node/ext/channel_credentials.cc
index 07763bd301..3d47ff293d 100644
--- a/src/node/ext/channel_credentials.cc
+++ b/src/node/ext/channel_credentials.cc
@@ -181,6 +181,10 @@ NAN_METHOD(ChannelCredentials::Compose) {
}
ChannelCredentials *self = ObjectWrap::Unwrap<ChannelCredentials>(
info.This());
+ if (self->wrapped_credentials == NULL) {
+ return Nan::ThrowTypeError(
+ "Cannot compose insecure credential");
+ }
CallCredentials *other = ObjectWrap::Unwrap<CallCredentials>(
Nan::To<Object>(info[0]).ToLocalChecked());
grpc_credentials *creds = grpc_composite_credentials_create(