Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Files.App/Utils/Storage/Helpers/SyncRootHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
19 changes: 13 additions & 6 deletions src/Files.App/ViewModels/Properties/Items/DriveProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading