From 5fe354869135da24b07c0b2127fa2ca39b5bbf4e Mon Sep 17 00:00:00 2001 From: Selene Date: Wed, 8 Feb 2023 17:08:56 +0100 Subject: [PATCH] RemoteCache: Fix null pointer exception in redis cache (#63094) Fix null pointer exception in redis cache --- pkg/infra/remotecache/redis_storage.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/infra/remotecache/redis_storage.go b/pkg/infra/remotecache/redis_storage.go index 4d646379d45..2f424756855 100644 --- a/pkg/infra/remotecache/redis_storage.go +++ b/pkg/infra/remotecache/redis_storage.go @@ -107,11 +107,10 @@ func (s *redisStorage) SetByteArray(ctx context.Context, key string, data []byte func (s *redisStorage) Get(ctx context.Context, key string) (interface{}, error) { v, err := s.GetByteArray(ctx, key) - if err.Error() == "EOF" { - return nil, ErrCacheItemNotFound - } - if err != nil { + if err.Error() == "EOF" { + return nil, ErrCacheItemNotFound + } return nil, err }