Fix deepEquals() crash when tag check is specified and only one item has a tag (#188)

This commit is contained in:
Dylan K. Taylor 2016-12-21 15:00:00 +00:00
parent 7190f6a4ca
commit 5feff79875

View File

@ -757,7 +757,7 @@ class Item implements ItemIds, \JsonSerializable{
public final function deepEquals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{ public final function deepEquals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{
if($this->equals($item, $checkDamage, $checkCompound)){ if($this->equals($item, $checkDamage, $checkCompound)){
return true; return true;
}elseif($item->hasCompoundTag() or $this->hasCompoundTag()){ }elseif($item->hasCompoundTag() and $this->hasCompoundTag()){
return NBT::matchTree($this->getNamedTag(), $item->getNamedTag()); return NBT::matchTree($this->getNamedTag(), $item->getNamedTag());
} }