diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 4c360e657..00b188484 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -3904,8 +3904,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ throw new \InvalidArgumentException("Cannot remove fixed window $id (" . get_class($inventory) . ") from " . $this->getName()); } - $inventory->close($this); if($id !== null){ + $inventory->close($this); unset($this->windows[$hash], $this->windowIndex[$id], $this->permanentWindows[$id]); } }