summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs/debugwindowtabs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/tabs/debugwindowtabs.cpp')
-rw-r--r--src/gui/widgets/tabs/debugwindowtabs.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/widgets/tabs/debugwindowtabs.cpp b/src/gui/widgets/tabs/debugwindowtabs.cpp
index 4a600d2fd..321c3bcad 100644
--- a/src/gui/widgets/tabs/debugwindowtabs.cpp
+++ b/src/gui/widgets/tabs/debugwindowtabs.cpp
@@ -183,8 +183,10 @@ void MapDebugTab::logic()
mXYLabel->setCaption(strprintf("%s (?, ?)", _("Player Position:")));
}
- const Map *const map = Game::instance()->getCurrentMap();
- if ((map != nullptr) && (viewport != nullptr))
+ Game *const game = Game::instance();
+ const Map *const map = game != nullptr ? game->getCurrentMap() : nullptr;
+ if (map != nullptr &&
+ viewport != nullptr)
{
// Get the current mouse position
const int mouseTileX = (viewport->mMouseX + viewport->getCameraX())