Skip to content

Commit a78a6bf

Browse files
committed
Fix when removing root node or current node
It is now impossible to remove the root node, and removing the current node sets the current node back to the root node.
1 parent a8758d3 commit a78a6bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Actions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ void Extension::RemoveSubnode(const char *Name)
4444
}
4545
void Extension::RemoveNodeByID(int ID)
4646
{
47+
if(ID == 0) return;
48+
if(ID == cur->ID) ReturnToRoot();
4749
for(std::map<int, SDNode *>::const_iterator it = SDNode::Nodes.begin(); it != SDNode::Nodes.end(); ++it)
4850
{
4951
for(SDNode::nmt::iterator jt = it->second->nm.begin(); jt != it->second->nm.end();)

0 commit comments

Comments
 (0)