Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Fix a crash when trying to merge down a layer created after a reference image addition
Dmitry Kazakova6428902cfd9
diff --git a/libs/image/kis_layer_utils.cpp b/libs/image/kis_layer_utils.cppindex 6f2f3f7199..cdb7ffbe73 100644--- a/libs/image/kis_layer_utils.cpp+++ b/libs/image/kis_layer_utils.cpp@@ -1431,6 +1431,11 @@ namespace Private {// XXX: this breaks if we allow free mixing of masks and layersKisLayerSP prevLayer = qobject_cast<KisLayer*>(layer->prevSibling().data());++ while (prevLayer && prevLayer->isFakeNode()) {+ prevLayer = qobject_cast<KisLayer*>(prevLayer->prevSibling().data());+ }+if (!prevLayer) return;if (!layer->visible() && !prevLayer->visible()) {