fix possible crash from null coming from _sentPackets

This commit is contained in:
Brad Hefta-Gaub 2015-09-30 14:16:41 -07:00
parent 88f0c7017e
commit 9cf49597a6

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;
}