From 89225090abc59cefec4d4c1b30aa5c35931e5ce7 Mon Sep 17 00:00:00 2001 From: Jian Qiu Date: Wed, 20 Apr 2022 15:00:35 +0800 Subject: [PATCH] fix: cached image fail to refresh (#14081) Co-authored-by: Qiu Jian --- pkg/compute/models/cachedimages.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/compute/models/cachedimages.go b/pkg/compute/models/cachedimages.go index bd0b3106fc..b50dd2ff5f 100644 --- a/pkg/compute/models/cachedimages.go +++ b/pkg/compute/models/cachedimages.go @@ -318,7 +318,7 @@ func (manager *SCachedimageManager) GetCachedimageById(ctx context.Context, user return cachedImage, nil } } - if errors.Cause(err) != sql.ErrNoRows { + if err != nil && errors.Cause(err) != sql.ErrNoRows { return nil, err } s := auth.GetAdminSession(ctx, options.Options.Region, "")