From da81c0266d2d599d53230d3a23e0a1ca69fb65d3 Mon Sep 17 00:00:00 2001 From: Joseph-Eugene Winzer Date: Wed, 13 Jul 2022 05:18:04 +0200 Subject: [PATCH] Fix empty undo history crash (fix #3417) m_undoHistory is not valid for tabs other than sprites. For example opening the README or Home tab does not initialize the undo history, thus aseprite will segfault when it tries to get its first entry. --- src/app/commands/cmd_undo_history.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/commands/cmd_undo_history.cpp b/src/app/commands/cmd_undo_history.cpp index 24e5bd404..1f752e791 100644 --- a/src/app/commands/cmd_undo_history.cpp +++ b/src/app/commands/cmd_undo_history.cpp @@ -113,7 +113,7 @@ public: [[fallthrough]]; case ui::kMouseMoveMessage: - if (hasCapture()) { + if (hasCapture() && m_undoHistory) { auto mouseMsg = static_cast(msg); const gfx::Rect bounds = this->bounds();