Skip to content

Commit

Permalink
Fix infinite seralisation recursion.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cazzar committed Feb 19, 2018
1 parent ce4a722 commit fe3d583
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Shoko.Server/API/v2/Modules/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,11 @@ private object GetSeriesGroups()
JMMUser user = (JMMUser)Context.CurrentUser;
if (para.id != 0)
{
return RepoFactory.AnimeSeries.GetByID(para.id)?.AllGroupsAbove;
var anime = RepoFactory.AnimeSeries.GetByID(para.id);
if (anime == null) return new List<Group>();
return anime.AllGroupsAbove.Select(s => Group.GenerateFromAnimeGroup(Context, s, user.JMMUserID,
para.nocast != 0, para.notag != 0, para.level, para.all != 0, para.filter, para.allpics != 0, para.pic,
para.tagfilter));
}
return APIStatus.BadRequest("missing 'id'");
}
Expand Down

0 comments on commit fe3d583

Please sign in to comment.