Closed scribblemaniac closed 3 years ago
@scribblemaniac Hi. Since this issue has been closed, just to make sure, when you're free can you check if the merged fix solves your original issue with this ticket? Thanks!
Can confirm this has been fixed.
@scribblemaniac Excellent thanks a lot for testing! 🙇
Issue Summary
Undoing a frame deletion can cause two actions to be undone, or a crash in some situations. This is likely the same issue as #843, although the steps to reproduce are more involved.
Steps to reproduce
System Information
Pencil2D Version: 6f0b75b, v0.6.5
Operating System: Ubuntu 20.04
RAM Size: 16 GB
Graphics Tablet: N/A
Developer Notes
This crash is happening when
Editor::backup
is called before reverting the deletion. In that function it usesgetLast*ImageAtFrame
, which returns null if there isn't a previous frame. If it's null, the backup is skipped, howeverEditor::undo
always decrementsmBackupIndex
whether or not the backup was successful. Thus it goes back two actions instead of one, or causes an out of bounds exception if it goes below 0.