Skip to content

Commit

Permalink
Merge pull request #716 from jorenn92/fix/fix-playlist-rule-nullpointer
Browse files Browse the repository at this point in the history
fix(rules): Resolved an issue where a nullpointer could occur when fe…
  • Loading branch information
jorenn92 authored Jan 6, 2024
2 parents 4228a85 + a0400b8 commit 47aa1fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/src/modules/api/plex-api/plex-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,10 @@ export class PlexApiService {
});

const filteredForRatingKey = (
itemResp.MediaContainer.Metadata as PlexLibraryItem[]
).filter((i) => i.ratingKey === libraryId);
itemResp?.MediaContainer?.Metadata as PlexLibraryItem[]
)?.filter((i) => i.ratingKey === libraryId);

if (filteredForRatingKey.length > 0) {
if (filteredForRatingKey && filteredForRatingKey.length > 0) {
filteredItems.push(item);
}
}
Expand Down

0 comments on commit 47aa1fd

Please sign in to comment.