diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/GetAzureBackupItem.cs b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/GetAzureBackupItem.cs index cf43973ea308..64f40ccc756f 100644 --- a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/GetAzureBackupItem.cs +++ b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Item/GetAzureBackupItem.cs @@ -68,12 +68,18 @@ public override void ExecuteCmdlet() var azureBackupDatasourceListResponse = AzureBackupClient.ListDataSources(DSQueryParam); - azureBackupDatasourceObjects = azureBackupDatasourceListResponse.Where(x => x.Properties.ContainerId.Split('/').Last().Equals(Container.ContainerUniqueName, System.StringComparison.InvariantCultureIgnoreCase)).ToList(); + if (azureBackupDatasourceListResponse != null) + { + azureBackupDatasourceObjects = azureBackupDatasourceListResponse.Where(x => x.Properties.ContainerId.Split('/').Last().Equals(Container.ContainerUniqueName, System.StringComparison.InvariantCultureIgnoreCase)).ToList(); + } if (this.Status == null) { var azureBackupPOListResponse = AzureBackupClient.ListProtectableObjects(POQueryParam); - azureBackupPOObjects = azureBackupPOListResponse.Where(x => x.Properties.ContainerId.Split('/').Last().Equals(Container.ContainerUniqueName, System.StringComparison.InvariantCultureIgnoreCase)).ToList(); + if (azureBackupPOListResponse != null) + { + azureBackupPOObjects = azureBackupPOListResponse.Where(x => x.Properties.ContainerId.Split('/').Last().Equals(Container.ContainerUniqueName, System.StringComparison.InvariantCultureIgnoreCase)).ToList(); + } } WriteDebug("Received azure backup item response"); @@ -90,9 +96,12 @@ public void WriteAzureBackupItem(List sourceDataSource { List targetList = new List(); - foreach (var item in sourceDataSourceList) + if (sourceDataSourceList != null) { - targetList.Add(new AzureBackupItem(item, azureBackupContainer)); + foreach (var item in sourceDataSourceList) + { + targetList.Add(new AzureBackupItem(item, azureBackupContainer)); + } } if (sourcePOList != null) diff --git a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Resources/Microsoft.Azure.Management.BackupServicesManagement.dll b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Resources/Microsoft.Azure.Management.BackupServicesManagement.dll index d861821e0dbe..e6b211fb2822 100644 Binary files a/src/ResourceManager/AzureBackup/Commands.AzureBackup/Resources/Microsoft.Azure.Management.BackupServicesManagement.dll and b/src/ResourceManager/AzureBackup/Commands.AzureBackup/Resources/Microsoft.Azure.Management.BackupServicesManagement.dll differ