From 253077c352703654bb4ad4f06fd89356fe58c62f Mon Sep 17 00:00:00 2001 From: otherview Date: Mon, 25 Sep 2023 14:26:28 +0100 Subject: [PATCH] Fix OG panic issues --- go/rpc/encrypted_client.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/go/rpc/encrypted_client.go b/go/rpc/encrypted_client.go index 9b749f9715..b9f6392b22 100644 --- a/go/rpc/encrypted_client.go +++ b/go/rpc/encrypted_client.go @@ -165,11 +165,18 @@ func (c *EncRPCClient) forwardLogs(clientChannel chan common.IDAndEncLog, logCh } case err := <-subscription.Err(): - if err != nil { - c.logger.Info("subscription closed", log.ErrKey, err) - } else { - c.logger.Trace("subscription closed") + if c == nil { + panic("c is nill") + } + if c.logger == nil { + panic("c.logger is nill") + } + if subscription == nil { + panic("subscription is nil") } + + c.logger.Info("subscription closed", log.ErrKey, err) + return } }