checks for empty settings

This commit is contained in:
Steffen Schröder 2014-01-05 16:04:36 +01:00
parent 3202194068
commit 417e460588
2 changed files with 2 additions and 8 deletions

View File

@ -107,10 +107,6 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
trigger_error($mysqli->error);
return false;
}
if ($result->num_rows <= 0) {
$result->close();
return true;
}
$loadedSettings = array();
while ($row = $result->fetch_object()) {
@ -119,6 +115,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
settype($loadedSettings[$row->settingName], gettype($scriptSettings[$row->settingName]));
}
$result->close();
if (!$loadedSettings) return true;
$success = $this->maniaControl->client->query('SetModeScriptSettings', $loadedSettings);
if (!$success) {

View File

@ -97,10 +97,6 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
trigger_error($mysqli->error);
return false;
}
if ($result->num_rows <= 0) {
$result->close();
return true;
}
$this->maniaControl->client->query('GetServerOptions');
$serverSettings = $this->maniaControl->client->getResponse();
@ -111,6 +107,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
settype($loadedSettings[$row->settingName], gettype($serverSettings[$row->settingName]));
}
$result->close();
if (!$loadedSettings) return true;
$success = $this->maniaControl->client->query('SetServerOptions', $loadedSettings);
if (!$success) {