From 021d1da15866c81fa839262491dfa2916caf61ee Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Wed, 3 Apr 2024 13:48:13 +0000 Subject: [PATCH] fix: panic when cloud config is not set --- pkg/azurefile/azurefile.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/azurefile/azurefile.go b/pkg/azurefile/azurefile.go index 3e7a6e5e82..7cd43c0624 100644 --- a/pkg/azurefile/azurefile.go +++ b/pkg/azurefile/azurefile.go @@ -1080,8 +1080,8 @@ func (d *Driver) GetTotalAccountQuota(ctx context.Context, subsID, resourceGroup // RemoveStorageAccountTag remove tag from storage account func (d *Driver) RemoveStorageAccountTag(ctx context.Context, subsID, resourceGroup, account, key string) error { - if d.cloud == nil { - return fmt.Errorf("cloud is nil") + if d.cloud == nil || d.cloud.StorageAccountClient == nil { + return fmt.Errorf("cloud or StorageAccountClient is nil") } // search in cache first cache, err := d.skipMatchingTagCache.Get(account, azcache.CacheReadTypeDefault)