An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: prevent TypeError in database General components with null server
Andras Bacsai74c70b431cfa
diff --git a/app/Livewire/Project/Database/Clickhouse/General.php b/app/Livewire/Project/Database/Clickhouse/General.phpindex b80775853e..d41609c75b 100644--- a/app/Livewire/Project/Database/Clickhouse/General.php+++ b/app/Livewire/Project/Database/Clickhouse/General.php@@ -16,7 +16,7 @@ class General extends Component{use AuthorizesRequests;- public Server $server;+ public ?Server $server = null;public StandaloneClickhouse $database;@@ -58,6 +58,11 @@ class General extends Componenttry {$this->syncData();$this->server = data_get($this->database, 'destination.server');+ if (! $this->server) {+ $this->dispatch('error', 'Database destination server is not configured.');++ return;+ }} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/Project/Database/Dragonfly/General.php b/app/Livewire/Project/Database/Dragonfly/General.phpindex 4b93e69d75..69633e302a 100644--- a/app/Livewire/Project/Database/Dragonfly/General.php+++ b/app/Livewire/Project/Database/Dragonfly/General.php@@ -18,7 +18,7 @@ class General extends Component{use AuthorizesRequests;- public Server $server;+ public ?Server $server = null;public StandaloneDragonfly $database;@@ -64,6 +64,11 @@ class General extends Componenttry {$this->syncData();$this->server = data_get($this->database, 'destination.server');+ if (! $this->server) {+ $this->dispatch('error', 'Database destination server is not configured.');++ return;+ }$existingCert = $this->database->sslCertificates()->first();diff --git a/app/Livewire/Project/Database/Keydb/General.php b/app/Livewire/Project/Database/Keydb/General.phpindex 016dc4e01d..20d0486dcb 100644--- a/app/Livewire/Project/Database/Keydb/General.php+++ b/app/Livewire/Project/Database/Keydb/General.php@@ -18,7 +18,7 @@ class General extends Component{use AuthorizesRequests;- public Server $server;+ public ?Server $server = null;public StandaloneKeydb $database;@@ -66,6 +66,11 @@ class General extends Componenttry {$this->syncData();$this->server = data_get($this->database, 'destination.server');+ if (! $this->server) {+ $this->dispatch('error', 'Database destination server is not configured.');++ return;+ }$existingCert = $this->database->sslCertificates()->first();diff --git a/app/Livewire/Project/Database/Mariadb/General.php b/app/Livewire/Project/Database/Mariadb/General.phpindex d565c61669..4de73f61c2 100644--- a/app/Livewire/Project/Database/Mariadb/General.php+++ b/app/Livewire/Project/Database/Mariadb/General.php@@ -18,7 +18,7 @@ class General extends Component{use AuthorizesRequests;- public Server $server;+ public ?Server $server = null;public StandaloneMariadb $database;@@ -124,6 +124,11 @@ class General extends Componenttry {$this->syncData();$this->server = data_get($this->database, 'destination.server');+ if (! $this->server) {+ $this->dispatch('error', 'Database destination server is not configured.');++ return;+ }$existingCert = $this->database->sslCertificates()->first();diff --git a/app/Livewire/Project/Database/Mongodb/General.php b/app/Livewire/Project/Database/Mongodb/General.phpindex f5ecfba1cc..534e90bc4c 100644--- a/app/Livewire/Project/Database/Mongodb/General.php+++ b/app/Livewire/Project/Database/Mongodb/General.php@@ -18,7 +18,7 @@ class General extends Component{use AuthorizesRequests;- public Server $server;+ public ?Server $server = null;public StandaloneMongodb $database;@@ -124,6 +124,11 @@ class General extends Componenttry {$this->syncData();$this->server = data_get($this->database, 'destination.server');+ if (! $this->server) {+ $this->dispatch('error', 'Database destination server is not configured.');++ return;+ }$existingCert = $this->database->sslCertificates()->first();diff --git a/app/Livewire/Project/Database/Mysql/General.php b/app/Livewire/Project/Database/Mysql/General.phpindex 22c6eb39ea..b66165527c 100644--- a/app/Livewire/Project/Database/Mysql/General.php+++ b/app/Livewire/Project/Database/Mysql/General.php@@ -20,7 +20,7 @@ class General extends Componentpublic StandaloneMysql $database;- public Server $server;+ public ?Server $server = null;public string $name;@@ -129,6 +129,11 @@ class General extends Componenttry {$this->syncData();$this->server = data_get($this->database, 'destination.server');+ if (! $this->server) {+ $this->dispatch('error', 'Database destination server is not configured.');++ return;+ }$existingCert = $this->database->sslCertificates()->first();diff --git a/app/Livewire/Project/Database/Postgresql/General.php b/app/Livewire/Project/Database/Postgresql/General.phpindex 5314d10840..eae6870b67 100644--- a/app/Livewire/Project/Database/Postgresql/General.php+++ b/app/Livewire/Project/Database/Postgresql/General.php@@ -20,7 +20,7 @@ class General extends Componentpublic StandalonePostgresql $database;- public Server $server;+ public ?Server $server = null;public string $name;@@ -142,6 +142,11 @@ class General extends Componenttry {$this->syncData();$this->server = data_get($this->database, 'destination.server');+ if (! $this->server) {+ $this->dispatch('error', 'Database destination server is not configured.');++ return;+ }$existingCert = $this->database->sslCertificates()->first();diff --git a/app/Livewire/Project/Database/Redis/General.php b/app/Livewire/Project/Database/Redis/General.phpindex a24a977ad7..6a17a60530 100644--- a/app/Livewire/Project/Database/Redis/General.php+++ b/app/Livewire/Project/Database/Redis/General.php@@ -18,7 +18,7 @@ class General extends Component{use AuthorizesRequests;- public Server $server;+ public ?Server $server = null;public StandaloneRedis $database;@@ -117,6 +117,11 @@ class General extends Componenttry {$this->syncData();$this->server = data_get($this->database, 'destination.server');+ if (! $this->server) {+ $this->dispatch('error', 'Database destination server is not configured.');++ return;+ }$existingCert = $this->database->sslCertificates()->first();