From e25a38e3fbb156ae2bc72cc66aef014ae3963407 Mon Sep 17 00:00:00 2001
From: Loïc Blot <nerzhul@users.noreply.github.com>
Date: Fri, 19 May 2017 07:25:27 +0200
Subject: When minimap is disabled in configuration, really disable it (#5771)

* When minimap is disabled in configuration, really disable it
---
 src/network/clientpackethandler.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/network')

diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp
index 0dd09c6d1..59669fe6d 100644
--- a/src/network/clientpackethandler.cpp
+++ b/src/network/clientpackethandler.cpp
@@ -1150,7 +1150,7 @@ void Client::handleCommand_HudSetFlags(NetworkPacket* pkt)
 	m_minimap_disabled_by_server = !(player->hud_flags & HUD_FLAG_MINIMAP_VISIBLE);
 
 	// Hide minimap if it has been disabled by the server
-	if (m_minimap_disabled_by_server && was_minimap_visible) {
+	if (m_minimap && m_minimap_disabled_by_server && was_minimap_visible) {
 		// defers a minimap update, therefore only call it if really
 		// needed, by checking that minimap was visible before
 		m_minimap->setMinimapMode(MINIMAP_MODE_OFF);
-- 
cgit v1.2.3