mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
Fix crash in ClearCommand removing empty cels
This commit is contained in:
parent
a6933b2c7a
commit
7faf8a1bb7
@ -78,6 +78,10 @@ void ClearCommand::onExecute(Context* context)
|
|||||||
ContextWriter writer(context);
|
ContextWriter writer(context);
|
||||||
Document* document = writer.document();
|
Document* document = writer.document();
|
||||||
bool visibleMask = document->isMaskVisible();
|
bool visibleMask = document->isMaskVisible();
|
||||||
|
|
||||||
|
if (!writer.cel())
|
||||||
|
return;
|
||||||
|
|
||||||
{
|
{
|
||||||
UndoTransaction undoTransaction(writer.context(), "Clear");
|
UndoTransaction undoTransaction(writer.context(), "Clear");
|
||||||
DocumentApi api = document->getApi();
|
DocumentApi api = document->getApi();
|
||||||
|
@ -1097,8 +1097,10 @@ void DocumentApi::replaceStockImage(Sprite* sprite, int imageIndex, Image* newIm
|
|||||||
// Clears the mask region in the current sprite with the specified background color.
|
// Clears the mask region in the current sprite with the specified background color.
|
||||||
void DocumentApi::clearMask(Layer* layer, Cel* cel, color_t bgcolor)
|
void DocumentApi::clearMask(Layer* layer, Cel* cel, color_t bgcolor)
|
||||||
{
|
{
|
||||||
|
ASSERT(cel);
|
||||||
ASSERT(layer == cel->layer());
|
ASSERT(layer == cel->layer());
|
||||||
Image* image = cel->image();
|
|
||||||
|
Image* image = (cel ? cel->image(): NULL);
|
||||||
if (!image)
|
if (!image)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user