From f1babb7fa04ad881228acf40f7c824283b215d16 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 8 Oct 2015 17:35:48 -0700 Subject: [PATCH] Fix bug in OctreeInboundPacketProcessor where node can be null --- .../src/octree/OctreeInboundPacketProcessor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp b/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp index cb94990037..92c08152f7 100644 --- a/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp +++ b/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp @@ -261,6 +261,12 @@ int OctreeInboundPacketProcessor::sendNackPackets() { } const SharedNodePointer& destinationNode = DependencyManager::get()->nodeWithUUID(nodeUUID); + // If the node no longer exists, wait until the ReceivedPacketProcessor has cleaned up the node + // to remove it from our stats list. + // FIXME Is it safe to clean it up here before ReceivedPacketProcess has? + if (!destinationNode) { + continue; + } // retrieve sequence number stats of node, prune its missing set SequenceNumberStats& sequenceNumberStats = nodeStats.getIncomingEditSequenceNumberStats();