ZippedResourcePack: Handle json decoding errors correctly

Previously this would crash if it failed to decode the JSON (https://forums.pmmp.io/threads/texture-pack-shows-errors-not-working.4880/)
This commit is contained in:
Dylan K. Taylor 2017-12-25 19:01:02 +00:00
parent ddbc5cf960
commit 3c4dca7fdb

View File

@ -86,7 +86,7 @@ class ZippedResourcePack implements ResourcePack{
$archive->close();
$manifest = json_decode($manifestData);
if(!self::verifyManifest($manifest)){
if($manifest === null or !self::verifyManifest($manifest)){
throw new \InvalidStateException("Could not load resource pack from $zipPath: manifest.json is invalid or incomplete");
}