From a19ebf82fddd2551035a00b6fe459a3054203f05 Mon Sep 17 00:00:00 2001 From: Jeb Bearer Date: Wed, 23 Aug 2023 08:15:20 -0700 Subject: [PATCH] Don't segfault when the executor fails with no response --- state/state.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/state/state.go b/state/state.go index 7078b7f..d5ede3c 100644 --- a/state/state.go +++ b/state/state.go @@ -547,7 +547,10 @@ func (s *State) ExecuteBatch(ctx context.Context, batch Batch, dbTx pgx.Tx) (*pb processBatchResponse, err := s.executorClient.ProcessBatch(ctx, processBatchRequest) if err != nil { - if processBatchResponse.Error != executor.EXECUTOR_ERROR_NO_ERROR { + if processBatchResponse == nil { + log.Errorf("error from executor without response: %v", err) + err = executor.ExecutorErr(executor.EXECUTOR_ERROR_UNSPECIFIED) + } else if processBatchResponse.Error != executor.EXECUTOR_ERROR_NO_ERROR { err = executor.ExecutorErr(processBatchResponse.Error) s.LogExecutorError(processBatchResponse.Error, processBatchRequest) }