Merge pull request #5957 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;
}