diff --git a/src/controllers/episodes/getByAniListId/anify.ts b/src/controllers/episodes/getByAniListId/anify.ts index 3449d0a..11d3c23 100644 --- a/src/controllers/episodes/getByAniListId/anify.ts +++ b/src/controllers/episodes/getByAniListId/anify.ts @@ -73,6 +73,9 @@ export async function getEpisodesFromAnify( }) .sort(sortByProperty(sourcePriority, "providerId")); + if (filteredEpisodesData.length === 0) { + return null; + } const selectedEpisodeData = filteredEpisodesData[0]; return { providerId: selectedEpisodeData.providerId,