Continue to throw exceptions when file is not found

This commit is contained in:
Dane Everitt 2022-02-26 11:54:12 -05:00
parent c16fa92904
commit 0dddcfca36
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -4,6 +4,7 @@ namespace Pterodactyl\Services\Helpers;
use Illuminate\Support\Arr;
use Illuminate\Filesystem\FilesystemManager;
use Illuminate\Contracts\Filesystem\FileNotFoundException;
class AssetHashService
{
@ -114,6 +115,10 @@ class AssetHashService
*/
protected function manifest(): array
{
if (!$this->filesystem->exists(self::MANIFEST_PATH)) {
throw new FileNotFoundException('No manifest file was found: ' . self::MANIFEST_PATH);
}
return self::$manifest ?: self::$manifest = json_decode(
$this->filesystem->get(self::MANIFEST_PATH),
true