checks for empty settings
This commit is contained in:
parent
3202194068
commit
417e460588
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user