summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-02-24 10:04:43 +0100
committerMattes D <github@xoft.cz>2015-02-24 10:04:43 +0100
commitc286b186c4905b0a36a6bae7bc2af6d672cd82e2 (patch)
tree2776014db5bad64eed5c1dd24a179d279d71e3ca
parentFixed race condition for TCP link deleting. (diff)
downloadcuberite-c286b186c4905b0a36a6bae7bc2af6d672cd82e2.tar
cuberite-c286b186c4905b0a36a6bae7bc2af6d672cd82e2.tar.gz
cuberite-c286b186c4905b0a36a6bae7bc2af6d672cd82e2.tar.bz2
cuberite-c286b186c4905b0a36a6bae7bc2af6d672cd82e2.tar.lz
cuberite-c286b186c4905b0a36a6bae7bc2af6d672cd82e2.tar.xz
cuberite-c286b186c4905b0a36a6bae7bc2af6d672cd82e2.tar.zst
cuberite-c286b186c4905b0a36a6bae7bc2af6d672cd82e2.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol18x.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 9b0f1c37c..22280f800 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -874,11 +874,15 @@ void cProtocol180::SendPlayerListUpdatePing(const cPlayer & a_Player)
{
ASSERT(m_State == 3); // In game mode?
- cPacketizer Pkt(*this, 0x38); // Playerlist Item packet
- Pkt.WriteVarInt(2);
- Pkt.WriteVarInt(1);
- Pkt.WriteUUID(a_Player.GetUUID());
- Pkt.WriteVarInt((UInt32)a_Player.GetClientHandle()->GetPing());
+ auto ClientHandle = a_Player.GetClientHandlePtr();
+ if (ClientHandle != nullptr)
+ {
+ cPacketizer Pkt(*this, 0x38); // Playerlist Item packet
+ Pkt.WriteVarInt(2);
+ Pkt.WriteVarInt(1);
+ Pkt.WriteUUID(a_Player.GetUUID());
+ Pkt.WriteVarInt(static_cast<UInt32>(ClientHandle->GetPing()));
+ }
}