diff --git a/application/forms/IcingaHostForm.php b/application/forms/IcingaHostForm.php index d7bca9c31..b9c03ce94 100644 --- a/application/forms/IcingaHostForm.php +++ b/application/forms/IcingaHostForm.php @@ -2,6 +2,7 @@ namespace Icinga\Module\Director\Forms; +use Exception; use Icinga\Exception\AuthenticationException; use Icinga\Module\Director\Auth\Permission; use Icinga\Module\Director\Auth\Restriction; @@ -83,7 +84,13 @@ protected function addClusteringElements() 'class' => 'autosubmit', ]); - if ($this->getSentOrResolvedObjectValue('has_agent') === 'y') { + try { + $hasAgent = $this->getSentOrResolvedObjectValue('has_agent') === 'y'; + } catch (Exception $e) { + $hasAgent = false; + } + + if ($hasAgent) { $this->addBoolean('master_should_connect', [ 'label' => $this->translate('Establish connection'), 'description' => $this->translate(