FIX: check if child is not nullptr on adding
This commit is contained in:
parent
22739d8ac4
commit
2850647c66
@ -168,7 +168,13 @@ namespace Tree
|
|||||||
*
|
*
|
||||||
* @param c - a shared_ptr to a BaseNode
|
* @param c - a shared_ptr to a BaseNode
|
||||||
*/
|
*/
|
||||||
void addChild(const std::shared_ptr<Tree::BaseNode> &c) {c->setParent(shared_from_this()); children.push_back(c); }
|
void addChild(const std::shared_ptr<Tree::BaseNode> &c) {
|
||||||
|
if (c!=nullptr)
|
||||||
|
{
|
||||||
|
c->setParent(shared_from_this());
|
||||||
|
children.push_back(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user