Merge pull request #11715 from cnsoft/cnsoft-patch-1

try to fix a nullptr bug.
This commit is contained in:
minggo 2015-05-08 09:55:13 +08:00
commit 5140afe24c
1 changed files with 1 additions and 1 deletions

View File

@ -513,7 +513,7 @@ void Sprite3D::createNode(NodeData* nodedata, Node* root, const MaterialDatas& m
{ {
if(it->bones.size() > 0 || singleSprite) if(it->bones.size() > 0 || singleSprite)
{ {
if(singleSprite) if(singleSprite && root!=nullptr)
root->setName(nodedata->id); root->setName(nodedata->id);
auto mesh = Mesh::create(nodedata->id, getMeshIndexData(it->subMeshId)); auto mesh = Mesh::create(nodedata->id, getMeshIndexData(it->subMeshId));
if(mesh) if(mesh)