Skip to content

Commit bea5c27

Browse files
authored
Fix: Fixed crash when trying to create bitmap from null IconData in SidebarPinnedModel.cs (#12333)
1 parent db3fb40 commit bea5c27

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Files.App/Data/Models/SidebarPinnedModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ public async Task<LocationItem> CreateLocationItemFromPathAsync(string path)
107107
{
108108
var iconData = await FileThumbnailHelper.LoadIconFromStorageItemAsync(res.Result, 96u, ThumbnailMode.ListView);
109109
locationItem.IconData = iconData;
110-
locationItem.Icon = await App.Window.DispatcherQueue.EnqueueOrInvokeAsync(() => locationItem.IconData.ToBitmapAsync());
110+
111+
if (locationItem.IconData is not null)
112+
locationItem.Icon = await App.Window.DispatcherQueue.EnqueueOrInvokeAsync(() => locationItem.IconData.ToBitmapAsync());
111113
}
112114

113115
if (locationItem.IconData is null)

0 commit comments

Comments
 (0)