Skip to content

Commit b1a729c

Browse files
committed
Fix an issue that throwing exception when some endpoint of storage account is empty.
1 parent 0ca624c commit b1a729c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/CLU/Microsoft.Azure.Commands.Management.Storage/Models/PSStorageAccount.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ public static PSStorageAccount Create(StorageModels.StorageAccount storageAccoun
8282
var credentials = StorageUtilities.GenerateStorageCredentials(client, result.ResourceGroupName, result.StorageAccountName);
8383
CloudStorageAccount account = new CloudStorageAccount(
8484
credentials,
85-
new Uri(storageAccount.PrimaryEndpoints.Blob),
86-
new Uri(storageAccount.PrimaryEndpoints.Queue),
87-
new Uri(storageAccount.PrimaryEndpoints.Table),
88-
new Uri(storageAccount.PrimaryEndpoints.File));
85+
null == storageAccount.PrimaryEndpoints.Blob ? null : new Uri(storageAccount.PrimaryEndpoints.Blob),
86+
null == storageAccount.PrimaryEndpoints.Queue ? null : new Uri(storageAccount.PrimaryEndpoints.Queue),
87+
null == storageAccount.PrimaryEndpoints.Table ? null : new Uri(storageAccount.PrimaryEndpoints.Table),
88+
null == storageAccount.PrimaryEndpoints.File ? null : new Uri(storageAccount.PrimaryEndpoints.File));
8989
result.Context = new AzureStorageContext(account);
9090
return result;
9191
}

0 commit comments

Comments
 (0)