Skip to content

Commit

Permalink
fix null exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kookxiang committed Jan 22, 2023
1 parent 0dfa6b1 commit 4864df1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Jellyfin.Plugin.Bangumi/PlaybackScrobbler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,12 @@ private async Task ReportPlaybackStatus(BaseItem item, Guid userId, bool played)
subjectId = episode.ParentId;
}

var ratingLevel = _localizationManager.GetRatingLevel(item.OfficialRating);
var ratingLevel = item.OfficialRating is null ? null : _localizationManager.GetRatingLevel(item.OfficialRating);
if (ratingLevel == null)
{
foreach (var parent in item.GetParents())
{
if (parent.OfficialRating == null) continue;
ratingLevel = _localizationManager.GetRatingLevel(parent.OfficialRating);
if (ratingLevel != null) break;
}
Expand Down

0 comments on commit 4864df1

Please sign in to comment.