mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Ensure SetImageAsync exceptions are handled
This commit is contained in:
parent
8cfaeeae6b
commit
61717dcd50
1 changed files with 14 additions and 5 deletions
|
|
@ -62,13 +62,22 @@ namespace Flow.Launcher
|
|||
|
||||
private async Task SetImageAsync(string imagePath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(imagePath) || !File.Exists(imagePath))
|
||||
try
|
||||
{
|
||||
Img.Visibility = Visibility.Collapsed;
|
||||
return;
|
||||
if (string.IsNullOrEmpty(imagePath) || !File.Exists(imagePath))
|
||||
{
|
||||
Img.Visibility = Visibility.Collapsed;
|
||||
return;
|
||||
}
|
||||
var imageSource = await App.API.LoadImageAsync(imagePath);
|
||||
Img.Source = imageSource;
|
||||
Img.Visibility = Visibility.Visible;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.API.LogException(ClassName, $"Failed to load UAC dialog image: {imagePath}", ex);
|
||||
Img.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
var imageSource = await App.API.LoadImageAsync(imagePath);
|
||||
Img.Source = imageSource;
|
||||
}
|
||||
|
||||
private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
|
||||
|
|
|
|||
Loading…
Reference in a new issue