Guard against Node linked-data being null

This commit is contained in:
Simon Walton 2019-03-26 17:41:22 -07:00
parent da6ca38282
commit b8f79d3364

View file

@ -265,8 +265,11 @@ void AvatarMixer::start() {
nodeList->nestedEach([&](NodeList::const_iterator cbegin, NodeList::const_iterator cend) {
std::for_each(cbegin, cend, [](const SharedNodePointer& node) {
if (node->getType() == NodeType::Agent) {
auto& avatar = static_cast<AvatarMixerClientData*>(node->getLinkedData())->getAvatar();
avatar.setNeedsHeroCheck();
NodeData* nodeData = node->getLinkedData();
if (nodeData) {
auto& avatar = static_cast<AvatarMixerClientData*>(nodeData)->getAvatar();
avatar.setNeedsHeroCheck();
}
}
});
});