Commit 44c4f74a authored by Sharaf Zaman's avatar Sharaf Zaman
Browse files

Fix nullptr crash: srcImage may not exist when deep-copying layers

parent 62c90ec3
Pipeline #221127 passed with stage
in 53 minutes and 46 seconds
......@@ -213,8 +213,9 @@ void KisMimeData::initializeExternalNode(KisNodeSP *node,
// attach the layer to a new shape controller
KisShapeLayer *shapeLayer2 = new KisShapeLayer(*shapeLayer, shapeController);
if (!qFuzzyCompare(dstImage->xRes(), srcImage->xRes()) ||
!qFuzzyCompare(dstImage->yRes(), srcImage->yRes())) {
if (srcImage
&& (!qFuzzyCompare(dstImage->xRes(), srcImage->xRes())
|| !qFuzzyCompare(dstImage->yRes(), srcImage->yRes()))) {
const QTransform t = QTransform::fromScale(srcImage->xRes() / dstImage->xRes(),
srcImage->yRes() / dstImage->yRes());
Supports Markdown
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