Skip to content

Commit 39cdc5a

Browse files
authored
Fix: Fixed possible NullReferenceException in widgets (#12171)
1 parent 1859e12 commit 39cdc5a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Files.App/UserControls/Widgets/DrivesWidget.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public async Task LoadCardThumbnailAsync()
6161

6262
// Thumbnail data is valid, set the item icon
6363
if (thumbnailData is not null && thumbnailData.Length > 0)
64-
Thumbnail = await App.Window.DispatcherQueue.EnqueueAsync(() => thumbnailData.ToBitmapAsync(Constants.Widgets.WidgetIconSize));
64+
Thumbnail = await thumbnailData.ToBitmapAsync(Constants.Widgets.WidgetIconSize);
6565
}
6666

6767
public int CompareTo(DriveCardItem? other) => Item.Path.CompareTo(other?.Item?.Path);

src/Files.App/UserControls/Widgets/QuickAccessWidget.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public async Task LoadCardThumbnailAsync()
9797
}
9898
if (thumbnailData is not null && thumbnailData.Length > 0)
9999
{
100-
Thumbnail = await App.Window.DispatcherQueue.EnqueueAsync(() => thumbnailData.ToBitmapAsync(Constants.Widgets.WidgetIconSize));
100+
Thumbnail = await thumbnailData.ToBitmapAsync(Constants.Widgets.WidgetIconSize);
101101
}
102102
}
103103
}

0 commit comments

Comments
 (0)