AnimNodeLoader: Fix for crash condition

When a node with children had an error loading, it would
lead to a nullptr dereference.
This commit is contained in:
Anthony J. Thibault 2015-10-16 09:29:59 -07:00
parent 2b4788929f
commit 9b9bd7fe26

View file

@ -160,6 +160,9 @@ static AnimNode::Pointer loadNode(const QJsonObject& jsonObj, const QUrl& jsonUr
assert((int)type >= 0 && type < AnimNode::Type::NumTypes);
auto node = (animNodeTypeToLoaderFunc(type))(dataObj, id, jsonUrl);
if (!node) {
return nullptr;
}
auto childrenValue = jsonObj.value("children");
if (!childrenValue.isArray()) {