Skip to content

Commit d61044c

Browse files
authored
Code Quality: Log errors when setting FolderBackgroundImageSource (#15918)
1 parent 4a905ff commit d61044c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Files.App/ViewModels/ShellViewModel.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,11 +1833,19 @@ public void CheckForBackgroundImage()
18331833
}
18341834
else
18351835
{
1836-
FolderBackgroundImageSource = new BitmapImage
1836+
try
18371837
{
1838-
UriSource = new Uri(backgroundImage, UriKind.RelativeOrAbsolute),
1839-
CreateOptions = BitmapCreateOptions.IgnoreImageCache
1840-
};
1838+
FolderBackgroundImageSource = new BitmapImage
1839+
{
1840+
UriSource = new Uri(backgroundImage, UriKind.RelativeOrAbsolute),
1841+
CreateOptions = BitmapCreateOptions.IgnoreImageCache
1842+
};
1843+
}
1844+
catch (Exception ex)
1845+
{
1846+
// Handle errors with setting the URI
1847+
App.Logger.LogWarning(ex, ex.Message);
1848+
}
18411849
}
18421850

18431851
// Opacity

0 commit comments

Comments
 (0)