mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 09:04:02 +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);
|
||||
Document* document = writer.document();
|
||||
bool visibleMask = document->isMaskVisible();
|
||||
|
||||
if (!writer.cel())
|
||||
return;
|
||||
|
||||
{
|
||||
UndoTransaction undoTransaction(writer.context(), "Clear");
|
||||
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.
|
||||
void DocumentApi::clearMask(Layer* layer, Cel* cel, color_t bgcolor)
|
||||
{
|
||||
ASSERT(cel);
|
||||
ASSERT(layer == cel->layer());
|
||||
Image* image = cel->image();
|
||||
|
||||
Image* image = (cel ? cel->image(): NULL);
|
||||
if (!image)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user