Fix crash using Edit > Cut after pasting the clipboard content on an empty cel

This commit is contained in:
David Capello 2019-09-07 11:43:22 -03:00
parent 5eb3119877
commit 559c3df6de

View File

@ -251,8 +251,12 @@ void PixelsMovement::trim()
}
m_tx(new cmd::ClearMask(cel));
}
if (cel->layer()->isTransparent())
// Current cel (m_site.cel()) can be nullptr when we paste in an
// empty cel (Ctrl+V) and cut (Ctrl+X) the floating pixels.
if (cel &&
cel->layer()->isTransparent()) {
m_tx(new cmd::TrimCel(cel));
}
}
if (restoreMask)