diff --git a/app/Exceptions/ManifestDoesNotExistException.php b/app/Exceptions/ManifestDoesNotExistException.php new file mode 100644 index 000000000..2769cd03c --- /dev/null +++ b/app/Exceptions/ManifestDoesNotExistException.php @@ -0,0 +1,15 @@ + 'https://github.com/pterodactyl/panel/blob/develop/package.json', + ]; + } +} diff --git a/app/Services/Helpers/AssetHashService.php b/app/Services/Helpers/AssetHashService.php index 2e1c1aaa6..725a56669 100644 --- a/app/Services/Helpers/AssetHashService.php +++ b/app/Services/Helpers/AssetHashService.php @@ -5,6 +5,7 @@ namespace Pterodactyl\Services\Helpers; use Illuminate\Support\Arr; use Illuminate\Filesystem\FilesystemManager; use Illuminate\Contracts\Filesystem\Filesystem; +use Pterodactyl\Exceptions\ManifestDoesNotExistException; class AssetHashService { @@ -106,6 +107,11 @@ class AssetHashService ); } - return static::$manifest; + $manifest = static::$manifest; + if ($manifest === null) { + throw new ManifestDoesNotExistException(); + } + + return $manifest; } }