ZippedResourcePack: fix mishandling of wrong root JSON type (crashdump #2840512)

This commit is contained in:
Dylan K. Taylor 2019-09-17 11:01:33 +01:00
parent d724374d1a
commit 70b1ac856d

View File

@ -104,7 +104,9 @@ class ZippedResourcePack implements ResourcePack{
}catch(\RuntimeException $e){
throw new ResourcePackException("Failed to parse manifest.json: " . $e->getMessage(), $e->getCode(), $e);
}
if(!($manifest instanceof \stdClass)){
throw new ResourcePackException("manifest.json should contain a JSON object, not " . gettype($manifest));
}
if(!self::verifyManifest($manifest)){
throw new ResourcePackException("manifest.json is missing required fields");
}