mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
LegacySkinAdapter: an extra check for resourcePatch (fixes 3 phpstan explicitMixed errors)
This commit is contained in:
parent
a9d98bdf73
commit
e105578be0
@ -26,6 +26,7 @@ namespace pocketmine\network\mcpe\protocol\types;
|
||||
use pocketmine\entity\InvalidSkinException;
|
||||
use pocketmine\entity\Skin;
|
||||
|
||||
use function is_array;
|
||||
use function is_string;
|
||||
use function json_decode;
|
||||
use function json_encode;
|
||||
@ -58,7 +59,7 @@ class LegacySkinAdapter implements SkinAdapter{
|
||||
$capeData = $data->isPersonaCapeOnClassic() ? "" : $data->getCapeImage()->getData();
|
||||
|
||||
$resourcePatch = json_decode($data->getResourcePatch(), true);
|
||||
if(isset($resourcePatch["geometry"]["default"]) && is_string($resourcePatch["geometry"]["default"])){
|
||||
if(is_array($resourcePatch) && isset($resourcePatch["geometry"]["default"]) && is_string($resourcePatch["geometry"]["default"])){
|
||||
$geometryName = $resourcePatch["geometry"]["default"];
|
||||
}else{
|
||||
throw new InvalidSkinException("Missing geometry name field");
|
||||
|
@ -455,11 +455,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/network/mcpe/protocol/StartGamePacket.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access offset 'geometry' on mixed\\.$#"
|
||||
count: 3
|
||||
path: ../../../src/pocketmine/network/mcpe/protocol/types/LegacySkinAdapter.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access offset string on mixed\\.$#"
|
||||
count: 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user