diff --git a/libs/image/kis_merge_walker.cc b/libs/image/kis_merge_walker.cc --- a/libs/image/kis_merge_walker.cc +++ b/libs/image/kis_merge_walker.cc @@ -53,27 +53,24 @@ void KisMergeWalker::startTripWithMask(KisProjectionLeafSP filthyMask) { - if (!filthyMask->parent()) { - /** - * Under very rare circumstances it may happen that the update - * queue will contain a job pointing to a node that has - * already been deleted from the image (direclty or by undo - * command). If it happens to a layer then the walker will - * handle it as usual by building a trivial graph pointing to - * nowhere, but when it happens to a mask... not. Because the - * mask is always expected to have a parent layer to process. - * - * So just handle it here separately. - */ - + /** + * Under very rare circumstances it may happen that the update + * queue will contain a job pointing to a node that has + * already been deleted from the image (direclty or by undo + * command). If it happens to a layer then the walker will + * handle it as usual by building a trivial graph pointing to + * nowhere, but when it happens to a mask... not. Because the + * mask is always expected to have a parent layer to process. + * + * So just handle it here separately. + */ + KisProjectionLeafSP parentLayer = filthyMask->parent(); + if (!parentLayer) { return; } adjustMasksChangeRect(filthyMask); - KisProjectionLeafSP parentLayer = filthyMask->parent(); - Q_ASSERT(parentLayer); - KisProjectionLeafSP nextLeaf = parentLayer->nextSibling(); KisProjectionLeafSP prevLeaf = parentLayer->prevSibling();