[Settings]Ensure PTRun plugin icon paths are well formed / add unhandled exception handler (#33374)

* Fixed production crash with bad icon paths in Launcher plugins

* Bumped MSBuildCacheCacheUniverse
This commit is contained in:
Ani 2024-06-16 17:58:25 +02:00 committed by GitHub
parent deb6234d72
commit f019163083
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 6 deletions

View File

@ -76,9 +76,16 @@ namespace Microsoft.PowerToys.Settings.UI
/// </summary>
public App()
{
Logger.InitializeLogger("\\Settings\\Logs");
Logger.InitializeLogger(@"\Settings\Logs");
this.InitializeComponent();
InitializeComponent();
UnhandledException += App_UnhandledException;
}
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
{
Logger.LogError("Unhandled exception", e.Exception);
}
public static void OpenSettingsWindow(Type type = null, bool ensurePageIsSelected = false)

View File

@ -179,10 +179,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
return $"{Name}. {Description}";
}
public string IconPath
{
get => isDark() ? settings.IconPathDark : settings.IconPathLight;
}
#nullable enable
public Uri? IconPath => Uri.TryCreate(isDark() ? settings.IconPathDark : settings.IconPathLight, UriKind.Absolute, out var uri) ? uri : null;
#nullable restore
public event PropertyChangedEventHandler PropertyChanged;