From a46e401746fe8e523f31fd63f60749c78feea562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sat, 14 Jun 2014 18:16:45 +0200 Subject: [PATCH] prevent exception --- application/core/Maps/MapManager.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index ecefa473..a6ed2d31 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -18,6 +18,7 @@ use Maniaplanet\DedicatedServer\Xmlrpc\FileException; use Maniaplanet\DedicatedServer\Xmlrpc\IndexOutOfBoundException; use Maniaplanet\DedicatedServer\Xmlrpc\InvalidMapException; use Maniaplanet\DedicatedServer\Xmlrpc\NotInListException; +use Maniaplanet\DedicatedServer\Xmlrpc\UnavailableFeatureException; // TODO: adding of local maps @@ -525,7 +526,11 @@ class MapManager implements CallbackListener { * @return Map */ private function fetchCurrentMap() { - $rpcMap = $this->maniaControl->client->getCurrentMapInfo(); + try { + $rpcMap = $this->maniaControl->client->getCurrentMapInfo(); + } catch (UnavailableFeatureException $exception) { + return null; + } if (array_key_exists($rpcMap->uId, $this->maps)) { $this->currentMap = $this->maps[$rpcMap->uId];