Skip to content
Snippets Groups Projects
Commit 6f98162b authored by Tim Emiola's avatar Tim Emiola
Browse files

Merge pull request #2999 from murgatroid99/node_test_fixes

Stop dereferencing an optional parameter without checking it
parents 43a53ffa fa266cad
No related branches found
No related tags found
No related merge requests found
...@@ -280,7 +280,9 @@ function makeUnaryRequestFunction(method, serialize, deserialize) { ...@@ -280,7 +280,9 @@ function makeUnaryRequestFunction(method, serialize, deserialize) {
} }
var client_batch = {}; var client_batch = {};
var message = serialize(argument); var message = serialize(argument);
message.grpcWriteFlags = options.flags; if (options) {
message.grpcWriteFlags = options.flags;
}
client_batch[grpc.opType.SEND_INITIAL_METADATA] = metadata; client_batch[grpc.opType.SEND_INITIAL_METADATA] = metadata;
client_batch[grpc.opType.SEND_MESSAGE] = message; client_batch[grpc.opType.SEND_MESSAGE] = message;
client_batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true; client_batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true;
...@@ -416,7 +418,9 @@ function makeServerStreamRequestFunction(method, serialize, deserialize) { ...@@ -416,7 +418,9 @@ function makeServerStreamRequestFunction(method, serialize, deserialize) {
} }
var start_batch = {}; var start_batch = {};
var message = serialize(argument); var message = serialize(argument);
message.grpcWriteFlags = options.flags; if (options) {
message.grpcWriteFlags = options.flags;
}
start_batch[grpc.opType.SEND_INITIAL_METADATA] = metadata; start_batch[grpc.opType.SEND_INITIAL_METADATA] = metadata;
start_batch[grpc.opType.RECV_INITIAL_METADATA] = true; start_batch[grpc.opType.RECV_INITIAL_METADATA] = true;
start_batch[grpc.opType.SEND_MESSAGE] = message; start_batch[grpc.opType.SEND_MESSAGE] = message;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment