diff --git a/src/grpc/stream_infer_handler.cc b/src/grpc/stream_infer_handler.cc index 6ab35f7be8..168da81121 100644 --- a/src/grpc/stream_infer_handler.cc +++ b/src/grpc/stream_infer_handler.cc @@ -269,9 +269,11 @@ ModelStreamInferHandler::Process(InferHandler::State* state, bool rpc_ok) } // Get request ID for logging in case of error. const char* request_id = ""; - LOG_TRITONSERVER_ERROR( - TRITONSERVER_InferenceRequestId(irequest, &request_id), - "unable to retrieve request ID string"); + if (irequest != nullptr) { + LOG_TRITONSERVER_ERROR( + TRITONSERVER_InferenceRequestId(irequest, &request_id), + "unable to retrieve request ID string"); + } if (!strncmp(request_id, "", 1)) { request_id = ""; }