ViewPhotoAlbum: prevent undefined index due to missing thumb

This commit is contained in:
Aaron van Geffen 2023-03-11 21:45:03 +01:00
parent 1b7e745f11
commit b8c53d7d4d

View File

@ -137,7 +137,8 @@ class ViewPhotoAlbum extends HTMLController
'id_tag' => $album['id_tag'],
'caption' => $album['tag'],
'link' => BASEURL . '/' . $album['slug'] . '/',
'thumbnail' => !empty($album['id_asset_thumb']) ? $assets[$album['id_asset_thumb']]->getImage() : null,
'thumbnail' => !empty($album['id_asset_thumb']) && isset($assets[$album['id_asset_thumb']])
? $assets[$album['id_asset_thumb']]->getImage() : null,
];
}