prevent crash when no settings

This commit is contained in:
Beu
2025-06-22 00:13:46 +02:00
parent 8e632d5057
commit 0fe9dc3e14

View File

@ -863,6 +863,7 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
} }
$allsettings = $this->maniaControl->getSettingManager()->getSettingsByClass($this); $allsettings = $this->maniaControl->getSettingManager()->getSettingsByClass($this);
$settingsmode = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MATCH_SETTINGS_MODE); $settingsmode = $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MATCH_SETTINGS_MODE);
if ($allsettings !== null && $settingsmode !== null) {
$modesettings = $this->getModeSettings($settingsmode); $modesettings = $this->getModeSettings($settingsmode);
foreach ($allsettings as $key => $value) { foreach ($allsettings as $key => $value) {
$name = $value->setting; $name = $value->setting;
@ -898,6 +899,7 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
} }
} }
} }
}
/** /**
* Load Gamemode settings excluding not used settings in custom gamemodes * Load Gamemode settings excluding not used settings in custom gamemodes