From 852741cb6ecbf282b75f7dd70a5be390b888e7a8 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 7 Nov 2021 04:16:45 -0500 Subject: [PATCH] fallback for broken assets --- globals/functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/globals/functions.php b/globals/functions.php index d3b7b7a..59965f9 100644 --- a/globals/functions.php +++ b/globals/functions.php @@ -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); + } } } }