[Script] Crashes with selection:deselect() and Undo (Ctrl+Z)

Version Infomation

Aseprite v1.2.20
Surface 6 pro/Windows 10 1903

Reproduction procedure

  1. Execute lua method “app.activeSprite.selection:deselect()” with nothing selected.
  2. Then Undo (Ctrl+Z) and Aseprite throws an exception and crashes.
    (Nothing should have been changed, but Undo will be made.)


[appendix 1.]

The methods that raised the exception as follows.

void Mask::copyFrom(const Mask* sourceMask)
line 120

The exception that occurred are as follows.

Exception has occurred: W32/0xc0000005
Exception thrown: read access violation.
sourceMask was nullptr.

I actually debugged it and found that the value of sourceMask was nullptr.

[appendix 2.]

When using the “app.command.DeselectMask()” .
no exceptions are raised under the same conditions.
Because nothing has been changed, I can’t Undo.


Is this a specification?
If so, you might want to include the following information as a supplementary item in documentation.
“Do not execute app.activeSprite.selection:deselect() with nothing selected.”

Hi @msk-k, thanks for reporting this bug, there will be fixed in the next release (maybe today).

1 Like

Fixed in Aseprite v1.2.21

1 Like