Commit 417f3967 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix a crash in the update mechanism

See a comment in KisMergeWalker::startTripWithMask()

BUG:353043
parent fc43e93b
......@@ -53,6 +53,22 @@ void KisMergeWalker::startTrip(KisProjectionLeafSP startLeaf)
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.
*/
return;
}
adjustMasksChangeRect(filthyMask);
KisProjectionLeafSP parentLayer = filthyMask->parent();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment