Skip to content

Commit faf68c0

Browse files
committed
fix: add null checks to categorization of plugins in plugin store
1 parent 7fdf3a2 commit faf68c0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ public string DefaultCategory
4646
get
4747
{
4848
string category = None;
49-
if (DateTime.Now - _newPlugin.LatestReleaseDate < TimeSpan.FromDays(7))
49+
if (_newPlugin.LatestReleaseDate is not null &&
50+
DateTime.Now - _newPlugin.LatestReleaseDate < TimeSpan.FromDays(7))
5051
{
5152
category = RecentlyUpdated;
5253
}
53-
if (DateTime.Now - _newPlugin.DateAdded < TimeSpan.FromDays(7))
54+
if (_newPlugin.DateAdded is not null &&
55+
DateTime.Now - _newPlugin.DateAdded < TimeSpan.FromDays(7))
5456
{
5557
category = NewRelease;
5658
}

0 commit comments

Comments
 (0)