prevent exception

This commit is contained in:
Steffen Schröder 2014-06-14 18:16:45 +02:00
parent 8592b4d47d
commit a46e401746

View File

@ -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() {
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];