GPv3: Fix TreeNode::parent_group() for root group

For the root group, the parent is `nullptr` so calling `parent_group()`
would fail. This fixes the issue by adding a null check and returning
`nullptr` otherwise.
This commit is contained in:
Falk David
2023-08-10 16:05:17 +02:00
parent a995e16cd2
commit 4f66031714

View File

@@ -481,7 +481,10 @@ Layer &TreeNode::as_layer_for_write()
LayerGroup *TreeNode::parent_group() const
{
return &this->parent->wrap();
if (this->parent) {
return &this->parent->wrap();
}
return nullptr;
}
LayerMask::LayerMask()