diff --git a/src/inventory/CreativeInventory.php b/src/inventory/CreativeInventory.php index c9eced613..136f2da92 100644 --- a/src/inventory/CreativeInventory.php +++ b/src/inventory/CreativeInventory.php @@ -38,8 +38,14 @@ final class CreativeInventory{ private function __construct(){ $creativeItems = json_decode(file_get_contents(Path::join(\pocketmine\BEDROCK_DATA_PATH, "creativeitems.json")), true); + if(!is_array($creativeItems)){ + throw new SavedDataLoadingException("Invalid creative items file, expected array as root type"); + } foreach($creativeItems as $data){ + if(!is_array($data)){ + throw new SavedDataLoadingException("Invalid creative items file, expected array as item type"); + } try{ $item = Item::legacyJsonDeserialize($data); }catch(SavedDataLoadingException){