BlockFactory: fix potential crash

This commit is contained in:
Dylan K. Taylor 2021-05-21 21:44:17 +01:00
parent 24405b63c1
commit ac04911e88
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -917,7 +917,7 @@ class BlockFactory{
$index = ($id << 4) | $meta;
if($this->isRegistered($id, $meta)){
$existing = $this->fullList[$index];
if($existing->getFullId() === $index){
if($existing !== null && $existing->getFullId() === $index){
throw new \InvalidArgumentException("$id:$meta is already mapped");
}else{
//if it's not a match, this was already remapped for some reason; remapping overwrites are OK