From 8c5b7b4b14d2cf8b0b03c74b63e34772aa804288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Mon, 30 Jun 2014 18:47:37 +0200 Subject: [PATCH] prevent error on null object --- application/core/Maps/MapManager.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index 7d942971..61f361ed 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -562,7 +562,10 @@ class MapManager implements CallbackListener { * Restructures the Maplist */ public function restructureMapList() { - $currentIndex = $this->getMapIndex($this->currentMap); + $currentIndex = 0; + if ($this->currentMap) { + $currentIndex = $this->getMapIndex($this->currentMap); + } // No RestructureNeeded if ($currentIndex < Maplist::MAX_MAPS_PER_PAGE - 1) {