add safe guard when remove component from node componentContainer

This commit is contained in:
andyque 2014-08-06 13:51:16 +08:00
parent 9f51adfafa
commit e2e8325f58
1 changed files with 4 additions and 1 deletions

View File

@ -1852,7 +1852,10 @@ bool Node::removeComponent(const std::string& name)
bool Node::removeComponent(Component *component)
{
return _componentContainer->remove(component);
if (_componentContainer) {
return _componentContainer->remove(component);
}
return false;
}
void Node::removeAllComponents()