mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Fix crash when new players join due to attempting to send negative inventory slot
This commit is contained in:
@ -103,6 +103,7 @@ abstract class BaseInventory implements Inventory{
|
||||
}
|
||||
|
||||
public function getItem($index){
|
||||
assert($index >= 0, "Inventory slot should not be negative");
|
||||
return isset($this->slots[$index]) ? clone $this->slots[$index] : Item::get(Item::AIR, 0, 0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user