Skip to content

Commit

Permalink
Hopefully fix null pointer in Seasons Filter
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Jan 23, 2024
1 parent 3547233 commit b91933b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Shoko.Server/Filters/FilterExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static Filterable ToFilterable(this SVR_AnimeSeries series, ILookup<int,
() => series.GetAnime()?.GetCustomTagsForAnime().Select(a => a.TagName).ToHashSet(StringComparer.InvariantCultureIgnoreCase) ??
new HashSet<string>(),
YearsDelegate = () => GetYears(series),
SeasonsDelegate = () => series.GetAnime()?.GetSeasons().ToHashSet(),
SeasonsDelegate = () => series.GetAnime()?.GetSeasons().ToHashSet() ?? new HashSet<(int Year, AnimeSeason Season)>(),
HasTvDBLinkDelegate = () => RepoFactory.CrossRef_AniDB_TvDB.GetByAnimeID(series.AniDB_ID).Any(),
HasMissingTvDbLinkDelegate = () => HasMissingTvDBLink(series),
// expensive, as these are direct
Expand Down Expand Up @@ -221,7 +221,7 @@ public static Filterable ToFilterable(this SVR_AnimeGroup group, ILookup<int, Cr
{
var parts = a.Split(' ');
return (int.Parse(parts[1]), Enum.Parse<AnimeSeason>(parts[0]));
}).ToHashSet(),
}).ToHashSet() ?? new HashSet<(int, AnimeSeason)>(),
HasTvDBLinkDelegate = () => series.Any(a => RepoFactory.CrossRef_AniDB_TvDB.GetByAnimeID(a.AniDB_ID).Any()),
HasMissingTvDbLinkDelegate = () => HasMissingTvDBLink(group),
HasTMDbLinkDelegate =
Expand Down

0 comments on commit b91933b

Please sign in to comment.