From 0d7f5e77c0ca60fd715e00f98b705c99fba2c097 Mon Sep 17 00:00:00 2001 From: Noah Eisen Date: Tue, 21 Nov 2017 12:19:37 -0800 Subject: [PATCH] No null string ctor --- include/grpc++/impl/codegen/call.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index 6a2ac8b70ca..4c2e550473b 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -588,10 +588,12 @@ class CallOpClientRecvStatus { binary_error_details = grpc::string(iter->second.begin(), iter->second.length()); } - *recv_status_ = Status(static_cast(status_code_), - grpc::string(GRPC_SLICE_START_PTR(error_message_), - GRPC_SLICE_END_PTR(error_message_)), - binary_error_details, grpc::string(error_string_)); + *recv_status_ = + Status(static_cast(status_code_), + grpc::string(GRPC_SLICE_START_PTR(error_message_), + GRPC_SLICE_END_PTR(error_message_)), + binary_error_details, + error_string_ != nullptr ? grpc::string(error_string_) : ""); g_core_codegen_interface->grpc_slice_unref(error_message_); g_core_codegen_interface->gpr_free((void*)error_string_); recv_status_ = nullptr;