Skip to content

Commit 61f6304

Browse files
author
Nicholas King
committed
Fix build, and add a null check
1 parent d72a48b commit 61f6304

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/ResourceManager/Websites/Commands.Websites/Cmdlets/BackupRestore/AzureWebAppBackup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class AzureWebAppBackup
1515
public int? BackupId { get; set; }
1616
public string BackupName { get; set; }
1717
public string BackupStatus { get; set; }
18-
public bool Scheduled { get; set; }
18+
public bool? Scheduled { get; set; }
1919
public long? BackupSizeInBytes { get; set; }
2020
public long? WebsiteSizeInBytes { get; set; }
2121
public DateTime? Created { get; set; }

src/ResourceManager/Websites/Commands.Websites/Cmdlets/BackupRestore/BackupRestoreUtils.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ public static FrequencyUnit StringToFrequencyUnit(string frequencyUnit)
1616

1717
public static AzureWebAppBackup BackupItemToAppBackup(BackupItem backup, string resourceGroupName, string name, string slot)
1818
{
19+
if (backup == null)
20+
{
21+
return new AzureWebAppBackup();
22+
}
1923
var dbs = backup.Databases == null ? null : backup.Databases.ToArray();
2024
string status = backup.Status == null ? null : backup.Status.ToString();
2125
return new AzureWebAppBackup

0 commit comments

Comments
 (0)