diff --git a/src/Shortcodes/FileShortcodeProvider.php b/src/Shortcodes/FileShortcodeProvider.php index 42feb332..60af995a 100644 --- a/src/Shortcodes/FileShortcodeProvider.php +++ b/src/Shortcodes/FileShortcodeProvider.php @@ -140,13 +140,10 @@ protected static function getCachedMarkup($cache, $cacheKey, $arguments): string { $item = $cache->get($cacheKey); $assetStore = Injector::inst()->get(AssetStore::class); - if ($item - && !empty($item['filename']) - && $assetStore->exists($item['filename'], $item['hash']) - && $item['markup']) { + if ($item && !empty($item['filename']) && $item['markup']) { // Initiate a protected asset grant if necessary $allowSessionGrant = static::getGrant(null, $arguments); - if ($allowSessionGrant) { + if ($allowSessionGrant && $assetStore->exists($item['filename'], $item['hash'])) { $assetStore->grant($item['filename'], $item['hash']); return $item['markup']; }