Make some anime detail pages more robust
timw4mail/HummingBirdAnimeClient/pipeline/head There was a failure building this commit Details

This commit is contained in:
Timothy Warren 2021-10-07 21:45:17 -04:00
parent c810b811a8
commit 08932ba8d2
1 changed files with 7 additions and 0 deletions

View File

@ -88,6 +88,13 @@ final class AnimeTransformer extends AbstractTransformer {
$role = $staffing['role'];
$name = $person['names']['localized'][$person['names']['canonical']];
// If this person object is so broken as to not have a proper image object,
// just skip it. No point in showing a role with nothing in it.
if ($person === null || $person['id'] === null || $person['image'] === null || $person['image']['original'] === null)
{
continue;
}
if ( ! array_key_exists($role, $staff))
{
$staff[$role] = [];