diff --git a/src/pocketmine/nbt/tag/CompoundTag.php b/src/pocketmine/nbt/tag/CompoundTag.php index e05e1d3d4..844213e35 100644 --- a/src/pocketmine/nbt/tag/CompoundTag.php +++ b/src/pocketmine/nbt/tag/CompoundTag.php @@ -82,7 +82,7 @@ class CompoundTag extends NamedTag implements \ArrayAccess{ * @return NamedTag|null * @throws \RuntimeException if the tag exists and is not of the expected type (if specified) */ - public function getTag(string $name, string $expectedType = null) : ?NamedTag{ + public function getTag(string $name, ?string $expectedType = null) : ?NamedTag{ assert($expectedType === null or is_a($expectedType, NamedTag::class, true)); $tag = $this->{$name} ?? null; if($tag !== null and $expectedType !== null and !($tag instanceof $expectedType)){