From a3df8130266479610019179eee4fb2b92b5b9977 Mon Sep 17 00:00:00 2001 From: Peter Broadhurst Date: Sun, 18 Jun 2023 22:06:04 -0400 Subject: [PATCH] Fix panic in un-register Signed-off-by: Peter Broadhurst --- internal/fabric/client/invokehandler.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/fabric/client/invokehandler.go b/internal/fabric/client/invokehandler.go index 9b3be50..5f3a758 100644 --- a/internal/fabric/client/invokehandler.go +++ b/internal/fabric/client/invokehandler.go @@ -55,6 +55,11 @@ func (h *txSubmitAndListenHandler) Handle(requestContext *invoke.RequestContext, select { case txStatus := <-statusNotifier: + if txStatus == nil { + requestContext.Error = status.New(status.EventServerStatus, int32(pb.TxValidationCode_INVALID_OTHER_REASON), + "channel closed due to unregister", nil) + return + } requestContext.Response.TxValidationCode = txStatus.TxValidationCode h.txStatusEvent.BlockNumber = txStatus.BlockNumber h.txStatusEvent.SourceURL = txStatus.SourceURL