mirror of https://github.com/axmolengine/axmol.git
add safe guard when remove component from node componentContainer
This commit is contained in:
parent
9f51adfafa
commit
e2e8325f58
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue