Fix possible crash when layout fails to open
This commit is contained in:
parent
bf3820745a
commit
59464aa89c
1 changed files with 2 additions and 2 deletions
|
@ -1166,7 +1166,7 @@ void Editor::setCursorRectVisible(bool visible) {
|
||||||
void Editor::onHoveredMapMetatileChanged(const QPoint &pos) {
|
void Editor::onHoveredMapMetatileChanged(const QPoint &pos) {
|
||||||
int x = pos.x();
|
int x = pos.x();
|
||||||
int y = pos.y();
|
int y = pos.y();
|
||||||
if (!layout->isWithinBounds(x, y))
|
if (!layout || !layout->isWithinBounds(x, y))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this->updateCursorRectPos(x, y);
|
this->updateCursorRectPos(x, y);
|
||||||
|
@ -1198,7 +1198,7 @@ void Editor::onHoveredMapMetatileCleared() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::onHoveredMapMovementPermissionChanged(int x, int y) {
|
void Editor::onHoveredMapMovementPermissionChanged(int x, int y) {
|
||||||
if (!layout->isWithinBounds(x, y))
|
if (!layout || !layout->isWithinBounds(x, y))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this->updateCursorRectPos(x, y);
|
this->updateCursorRectPos(x, y);
|
||||||
|
|
Loading…
Reference in a new issue