From 59464aa89cebc50375f62d7345261eb0fcb5db89 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 16 Dec 2024 14:39:23 -0500 Subject: [PATCH] Fix possible crash when layout fails to open --- src/editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor.cpp b/src/editor.cpp index 56914c30..d0a122ec 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -1166,7 +1166,7 @@ void Editor::setCursorRectVisible(bool visible) { void Editor::onHoveredMapMetatileChanged(const QPoint &pos) { int x = pos.x(); int y = pos.y(); - if (!layout->isWithinBounds(x, y)) + if (!layout || !layout->isWithinBounds(x, y)) return; this->updateCursorRectPos(x, y); @@ -1198,7 +1198,7 @@ void Editor::onHoveredMapMetatileCleared() { } void Editor::onHoveredMapMovementPermissionChanged(int x, int y) { - if (!layout->isWithinBounds(x, y)) + if (!layout || !layout->isWithinBounds(x, y)) return; this->updateCursorRectPos(x, y);