3
0
Fork 0
mirror of https://github.com/JulianGro/overte.git synced 2025-04-30 14:22:56 +02:00

Merge pull request from ZappoMan/fixSentPacketHistoryCrash

fix possible crash from null coming from _sentPackets
This commit is contained in:
Ryan Huffman 2015-09-30 15:12:09 -07:00
commit b7cfc07748

View file

@ -51,5 +51,9 @@ const NLPacket* SentPacketHistory::getPacket(uint16_t sequenceNumber) const {
}
QReadLocker locker(&_packetsLock);
return _sentPackets.get(seqDiff)->get();
auto packet = _sentPackets.get(seqDiff);
if (packet) {
return packet->get();
}
return nullptr;
}