Unverified Commit bda44d29 authored by Laurent Calvet's avatar Laurent Calvet Committed by GitHub
Browse files

Prevent adding new host with an empty name (#8626)

parent 27aeef3f
...@@ -43,7 +43,7 @@ class HostConfigurationService implements HostConfigurationServiceInterface ...@@ -43,7 +43,7 @@ class HostConfigurationService implements HostConfigurationServiceInterface
*/ */
public function addHost(Host $host): int public function addHost(Host $host): int
{ {
if ($host->getName() === null) { if (empty($host->getName())) {
throw new HostConfigurationException('Host name can not be empty'); throw new HostConfigurationException('Host name can not be empty');
} }
try { try {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment