fix: nil pointer dereference when failed to scan out the quota records from redis (#21046)

Signed-off-by: Liang Zheng <zhengliang0901@gmail.com>
This commit is contained in:
Liang Zheng 2024-10-15 15:13:13 +08:00 committed by GitHub
parent ab3d3504fb
commit de6c96be4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,6 +123,7 @@ func flushQuota(ctx context.Context) {
iter, err := cache.Default().Scan(ctx, "quota:*") iter, err := cache.Default().Scan(ctx, "quota:*")
if err != nil { if err != nil {
log.Errorf("failed to scan out the quota records from redis") log.Errorf("failed to scan out the quota records from redis")
return
} }
for iter.Next(ctx) { for iter.Next(ctx) {