Skip to content
Permalink
Browse files

fix(response): ensure null or client/server response is returned

  • Loading branch information
mbroadst committed Jul 2, 2018
1 parent b365934 commit 083518f96bfcddad15dffc123e79d89f6ec07554
Showing with 10 additions and 8 deletions.
  1. +5 −4 src/kerberos_client.cc
  2. +5 −4 src/kerberos_server.cc
@@ -93,11 +93,12 @@ class ClientStepWorker : public Nan::AsyncWorker {
private:
virtual void HandleOKCallback() {
Nan::HandleScope scope;
v8::Local<v8::Value> argv[] = {
Nan::Null(),
Nan::New(_client->_state->response).ToLocalChecked()
};
v8::Local<v8::Value> response = Nan::Null();
if (_client->_state->response != NULL) {
response = Nan::New(_client->_state->response).ToLocalChecked();
}

v8::Local<v8::Value> argv[] = { Nan::Null(), response };
callback->Call(2, argv, async_resource);
}

@@ -93,11 +93,12 @@ class ServerStepWorker : public Nan::AsyncWorker {
private:
virtual void HandleOKCallback() {
Nan::HandleScope scope;
v8::Local<v8::Value> argv[] = {
Nan::Null(),
Nan::New(_server->_state->response).ToLocalChecked()
};
v8::Local<v8::Value> response = Nan::Null();
if (_server->_state->response != NULL) {
response = Nan::New(_server->_state->response).ToLocalChecked();
}

v8::Local<v8::Value> argv[] = { Nan::Null(), response };
callback->Call(2, argv, async_resource);
}

0 comments on commit 083518f

Please sign in to comment.
You can’t perform that action at this time.