fallback for broken assets

This commit is contained in:
Austin 2021-11-07 04:16:45 -05:00
parent 4973f1087f
commit 852741cb6e
1 changed files with 6 additions and 2 deletions

View File

@ -5110,14 +5110,18 @@ function getAssetRender($id)
if ($assetinfo->AssetTypeId == 1 || $assetinfo->AssetTypeId == 22) //images and group emblems
{
$assethash = $assetinfo->Hash;
return constructThumbnailHashUrl($assethash);
if (file_exists($GLOBALS['thumbnailCDNPath'].$assethash)) {
return constructThumbnailHashUrl($assethash);
}
}
else //default to grab the assets ThumbHash
{
if (!empty($assetinfo->ThumbHash)) //if a render was ever performed
{
$thumbhash = $assetinfo->ThumbHash;
return constructRenderHashUrl($thumbhash);
if (file_exists($GLOBALS['renderCDNPath'].$thumbhash)) {
return constructRenderHashUrl($thumbhash);
}
}
}
}