Reinstated a couple of null checks related to the previous revert.

0.7.1-dev
Diva Canto 2011-02-10 06:26:26 -08:00
parent 89bb5c0941
commit 45382e6f82
1 changed files with 15 additions and 11 deletions

View File

@ -143,6 +143,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Process all the pending adds // Process all the pending adds
OutgoingPacket pendingAdd; OutgoingPacket pendingAdd;
while (m_pendingAdds.TryDequeue(out pendingAdd)) while (m_pendingAdds.TryDequeue(out pendingAdd))
if (pendingAdd != null)
m_packets[pendingAdd.SequenceNumber] = pendingAdd; m_packets[pendingAdd.SequenceNumber] = pendingAdd;
// Process all the pending removes, including updating statistics and round-trip times // Process all the pending removes, including updating statistics and round-trip times
@ -151,6 +152,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
while (m_pendingRemoves.TryDequeue(out pendingRemove)) while (m_pendingRemoves.TryDequeue(out pendingRemove))
{ {
if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
{
if (ackedPacket != null)
{ {
m_packets.Remove(pendingRemove.SequenceNumber); m_packets.Remove(pendingRemove.SequenceNumber);
@ -168,4 +171,5 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
} }
}
} }