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.
This commit is contained in:
Joseph-Eugene Winzer 2022-07-13 05:18:04 +02:00
parent 9a3958278b
commit da81c0266d

View File

@ -113,7 +113,7 @@ public:
[[fallthrough]];
case ui::kMouseMoveMessage:
if (hasCapture()) {
if (hasCapture() && m_undoHistory) {
auto mouseMsg = static_cast<ui::MouseMessage*>(msg);
const gfx::Rect bounds = this->bounds();