From c7ce8e5ce017e2166ad33599f27ed9e1998db968 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 7 Aug 2018 10:58:13 -0700 Subject: [PATCH] check node data pointers in handleNodeIgnoreRequestPacket --- assignment-client/src/avatars/AvatarMixer.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index 772c8643b3..bbc774eea6 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -643,6 +643,7 @@ void AvatarMixer::handleNodeIgnoreRequestPacket(QSharedPointer auto start = usecTimestampNow(); auto nodeList = DependencyManager::get(); AvatarMixerClientData* nodeData = reinterpret_cast(senderNode->getLinkedData()); + bool addToIgnore; message->readPrimitive(&addToIgnore); while (message->getBytesLeftToRead()) { @@ -650,17 +651,22 @@ void AvatarMixer::handleNodeIgnoreRequestPacket(QSharedPointer QUuid ignoredUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID)); if (nodeList->nodeWithUUID(ignoredUUID)) { - // Reset the lastBroadcastTime for the ignored avatar to 0 - // so the AvatarMixer knows it'll have to send identity data about the ignored avatar - // to the ignorer if the ignorer unignores. - nodeData->setLastBroadcastTime(ignoredUUID, 0); + if (nodeData) { + // Reset the lastBroadcastTime for the ignored avatar to 0 + // so the AvatarMixer knows it'll have to send identity data about the ignored avatar + // to the ignorer if the ignorer unignores. + nodeData->setLastBroadcastTime(ignoredUUID, 0); + } + // Reset the lastBroadcastTime for the ignorer (FROM THE PERSPECTIVE OF THE IGNORED) to 0 // so the AvatarMixer knows it'll have to send identity data about the ignorer // to the ignored if the ignorer unignores. auto ignoredNode = nodeList->nodeWithUUID(ignoredUUID); AvatarMixerClientData* ignoredNodeData = reinterpret_cast(ignoredNode->getLinkedData()); - ignoredNodeData->setLastBroadcastTime(senderNode->getUUID(), 0); + if (ignoredNodeData) { + ignoredNodeData->setLastBroadcastTime(senderNode->getUUID(), 0); + } } if (addToIgnore) {