Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DBUS] Don't break when reading settings from org.freedesktop.portalSettings v1 #15654

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/Avalonia.FreeDesktop/DBusPlatformSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@ private async Task TryGetInitialValuesAsync()
if (version >= 2)
value = await _settings!.ReadOneAsync("org.freedesktop.appearance", "color-scheme");
else
value = (await _settings!.ReadAsync("org.freedesktop.appearance", "color-scheme")).GetItem(0);
return ToColorScheme(value.GetUInt32());
value = await _settings!.ReadAsync("org.freedesktop.appearance", "color-scheme");

if (value.Type == VariantValueType.Int32)
return ToColorScheme(value.GetUInt32());
}
catch (DBusException)
{
return null;

}
return null;
}

private async Task<Color?> TryGetAccentColorAsync()
Expand Down