Fix empty public port in database configuration

This commit is contained in:
Andras Bacsai
2023-11-08 09:30:38 +01:00
parent 4dc3db3845
commit c365d132af
4 changed files with 14 additions and 3 deletions

View File

@@ -42,10 +42,13 @@ class General extends Component
public function submit()
{
try {
$this->validate();
if ($this->database->mongo_conf === "") {
if (str($this->database->public_port)->isEmpty()) {
$this->database->public_port = null;
}
if (str($this->database->mongo_conf)->isEmpty()) {
$this->database->mongo_conf = null;
}
$this->validate();
$this->database->save();
$this->emit('success', 'Database updated successfully.');
} catch (Exception $e) {