Skip to content

Commit

Permalink
#123 Fix some thing (crash on null handler)
Browse files Browse the repository at this point in the history
  • Loading branch information
ducphamhong committed May 13, 2022
1 parent d23fe77 commit af7c2d2
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -909,15 +909,17 @@ namespace Skylicht
{
// delete entity
CEntityHandleData* data = entity->getData<CEntityHandleData>();
if (data != NULL)
{
CEntityHandler* handler = data->Handler;
handler->removeEntity(entity);

CEntityHandler* handler = data->Handler;
handler->removeEntity(entity);

// remove gui hierachy
if (m_spaceHierarchy != NULL)
m_spaceHierarchy->getController()->updateTreeNode(handler->getGameObject());
// remove gui hierachy
if (m_spaceHierarchy != NULL)
m_spaceHierarchy->getController()->updateTreeNode(handler->getGameObject());

modifyGameObjects.push_back(handler->getGameObject());
modifyGameObjects.push_back(handler->getGameObject());
}
}
}
}
Expand Down

0 comments on commit af7c2d2

Please sign in to comment.