mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Ensure swallowGroup does not swallow the root node
Fixes a segfault
This commit is contained in:
parent
9082d9259f
commit
1e4681bfeb
1 changed files with 6 additions and 2 deletions
|
@ -198,8 +198,12 @@ void Hy3Node::recalcSizePosRecursive(bool force) {
|
|||
}
|
||||
|
||||
bool swallowGroup(Hy3Node* into) {
|
||||
if (into == nullptr || into->data.type != Hy3NodeData::Group) return false;
|
||||
if (into->data.as_group.children.size() != 1) return false;
|
||||
if (into == nullptr
|
||||
|| into->parent == nullptr
|
||||
|| into->data.type != Hy3NodeData::Group
|
||||
|| into->data.as_group.children.size() != 1)
|
||||
return false;
|
||||
|
||||
auto* child = into->data.as_group.children.front();
|
||||
|
||||
Debug::log(LOG, "Swallowing %p into %p", child, into);
|
||||
|
|
Loading…
Add table
Reference in a new issue