Skip to content

Commit 2e7a7f8

Browse files
authored
Merge pull request #4406 from DavidGBrett/fix--add-null-checks-to-categorization-of-plugins-in-plugin-store
fix: add null checks to categorization of plugins in plugin store
2 parents 7fdf3a2 + faf68c0 commit 2e7a7f8

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)