add guard around nodeData on delete

This commit is contained in:
ZappoMan 2013-10-28 12:07:56 -07:00
parent 1c2e5eecd6
commit 3ed61db873

View file

@ -20,7 +20,9 @@ void NodeWatcher::nodeKilled(Node* node) {
// Use this to cleanup our node
if (node->getType() == NODE_TYPE_AGENT) {
VoxelNodeData* nodeData = (VoxelNodeData*)node->getLinkedData();
node->setLinkedData(NULL);
delete nodeData;
if (nodeData) {
node->setLinkedData(NULL);
delete nodeData;
}
}
};