mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
BlockFactory: fix potential crash
This commit is contained in:
parent
24405b63c1
commit
ac04911e88
@ -917,7 +917,7 @@ class BlockFactory{
|
|||||||
$index = ($id << 4) | $meta;
|
$index = ($id << 4) | $meta;
|
||||||
if($this->isRegistered($id, $meta)){
|
if($this->isRegistered($id, $meta)){
|
||||||
$existing = $this->fullList[$index];
|
$existing = $this->fullList[$index];
|
||||||
if($existing->getFullId() === $index){
|
if($existing !== null && $existing->getFullId() === $index){
|
||||||
throw new \InvalidArgumentException("$id:$meta is already mapped");
|
throw new \InvalidArgumentException("$id:$meta is already mapped");
|
||||||
}else{
|
}else{
|
||||||
//if it's not a match, this was already remapped for some reason; remapping overwrites are OK
|
//if it's not a match, this was already remapped for some reason; remapping overwrites are OK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user