diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 897050375b..fd54406137 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3962,24 +3962,27 @@ int Application::parseVoxelStats(unsigned char* messageData, ssize_t messageLeng // But, also identify the sender, and keep track of the contained jurisdiction root for this server Node* voxelServer = NodeList::getInstance()->nodeWithAddress(&senderAddress); - uint16_t nodeID = voxelServer->getNodeID(); - - VoxelPositionSize jurisditionDetails; - voxelDetailsForCode(_voxelSceneStats.getJurisdictionRoot(), jurisditionDetails); - // see if this is the first we've heard of this node... - if (_voxelServerJurisdictions.find(nodeID) == _voxelServerJurisdictions.end()) { - printf("stats from new voxel server... v[%f, %f, %f, %f]\n", - jurisditionDetails.x, jurisditionDetails.y, jurisditionDetails.z, jurisditionDetails.s); + // quick fix for crash... why would voxelServer be NULL? + if (voxelServer) { + uint16_t nodeID = voxelServer->getNodeID(); - // Add the jurisditionDetails object to the list of "fade outs" - VoxelFade fade(VoxelFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE); - fade.voxelDetails = jurisditionDetails; - _voxelFades.push_back(fade); + VoxelPositionSize jurisditionDetails; + voxelDetailsForCode(_voxelSceneStats.getJurisdictionRoot(), jurisditionDetails); + + // see if this is the first we've heard of this node... + if (_voxelServerJurisdictions.find(nodeID) == _voxelServerJurisdictions.end()) { + printf("stats from new voxel server... v[%f, %f, %f, %f]\n", + jurisditionDetails.x, jurisditionDetails.y, jurisditionDetails.z, jurisditionDetails.s); + + // Add the jurisditionDetails object to the list of "fade outs" + VoxelFade fade(VoxelFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE); + fade.voxelDetails = jurisditionDetails; + _voxelFades.push_back(fade); + } + // store jurisdiction details for later use + _voxelServerJurisdictions[nodeID] = jurisditionDetails; } - // store jurisdiction details for later use - _voxelServerJurisdictions[nodeID] = jurisditionDetails; - return statsMessageLength; }