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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user