diff --git a/src/Files.App/Utils/Storage/Helpers/SyncRootHelpers.cs b/src/Files.App/Utils/Storage/Helpers/SyncRootHelpers.cs index e49eb08c3f05..042fb8564e1a 100644 --- a/src/Files.App/Utils/Storage/Helpers/SyncRootHelpers.cs +++ b/src/Files.App/Utils/Storage/Helpers/SyncRootHelpers.cs @@ -60,7 +60,7 @@ private static unsafe (bool Success, ulong Capacity, ulong Used) GetSyncRootQuot return (false, 0, 0); } - if (syncRootInfo is null) + if (syncRootInfo is null || syncRootInfo.Id is null) { return (false, 0, 0); } diff --git a/src/Files.App/ViewModels/Properties/Items/DriveProperties.cs b/src/Files.App/ViewModels/Properties/Items/DriveProperties.cs index 8489450903e1..4f0e0ee648ce 100644 --- a/src/Files.App/ViewModels/Properties/Items/DriveProperties.cs +++ b/src/Files.App/ViewModels/Properties/Items/DriveProperties.cs @@ -71,13 +71,20 @@ public async override Task GetSpecialPropertiesAsync() return; } - var syncRootStatus = await SyncRootHelpers.GetSyncRootQuotaAsync(Drive.Path); - if (syncRootStatus.Success) + try { - ViewModel.DriveCapacityValue = syncRootStatus.Capacity; - ViewModel.DriveUsedSpaceValue = syncRootStatus.Used; - ViewModel.DriveFreeSpaceValue = syncRootStatus.Capacity - syncRootStatus.Used; - return; + var syncRootStatus = await SyncRootHelpers.GetSyncRootQuotaAsync(Drive.Path); + if (syncRootStatus.Success) + { + ViewModel.DriveCapacityValue = syncRootStatus.Capacity; + ViewModel.DriveUsedSpaceValue = syncRootStatus.Used; + ViewModel.DriveFreeSpaceValue = syncRootStatus.Capacity - syncRootStatus.Used; + return; + } + } + catch (Exception e) + { + App.Logger.LogWarning(e, "Failed to get sync root quota for path: {Path}", Drive.Path); } try