From 46feb6ba3233df50cbd569212284a1c287f459f3 Mon Sep 17 00:00:00 2001 From: Andrew Baptist Date: Fri, 31 Mar 2023 08:51:57 -0400 Subject: [PATCH] rpc: correctly check for nil before cast As part of the fix of #99104, a cast without a nil check was introduced. This PR addresses that by only casting if it is known to be not nil. Epic: none Fixes: #100275 Release note: None --- pkg/rpc/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/rpc/context.go b/pkg/rpc/context.go index dc7c5dc4068f..097cb297c42e 100644 --- a/pkg/rpc/context.go +++ b/pkg/rpc/context.go @@ -2715,7 +2715,7 @@ func (rpcCtx *Context) loadOrCreateConnAttempt( select { case <-previousAttempt.initialHeartbeatDone: // The connection attempt was completed, return the outcome of it. - err := previousAttempt.err.Load().(error) + err, _ := previousAttempt.err.Load().(error) if err == nil { // If it completed without error then don't track the connection // anymore. If it did have an error we need to track it until it later gets cleared.