Fixed incompatible protocol message showing an empty pair of brackets when protocol is null

this happens if an exception occurs while or before trying to read the protocol version
This commit is contained in:
Dylan K. Taylor 2017-10-23 19:44:19 +01:00
parent 13e5718463
commit 0df3b00de4

View File

@ -1965,7 +1965,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
}
//This pocketmine disconnect message will only be seen by the console (PlayStatusPacket causes the messages to be shown for the client)
$this->close("", $this->server->getLanguage()->translateString("pocketmine.disconnect.incompatibleProtocol", [$packet->protocol]), false);
$this->close("", $this->server->getLanguage()->translateString("pocketmine.disconnect.incompatibleProtocol", [$packet->protocol ?? "unknown"]), false);
return true;
}