small fix mapmanager

This commit is contained in:
kremsy 2014-04-20 16:09:32 +02:00 committed by Steffen Schröder
parent 93605de685
commit 0859f54722

View File

@ -200,16 +200,15 @@ class MapManager implements CallbackListener {
public function updateMap(Player $admin, $uid) {
$this->updateMapTimestamp($uid);
if (!isset($uid)) {
if (!isset($uid) || !isset($this->maps[$uid])) {
trigger_error("Error while updating Map, unkown UID: " . $uid);
$this->maniaControl->chat->sendError("Error while updating Map.", $admin->login);
return;
}
/** @var Map $map */
$map = $this->maps[$uid];
/**
* @var Map $map
*/
$mxId = $map->mx->id;
$this->removeMap($admin, $uid, true, false);
$this->addMapFromMx($mxId, $admin->login, true);