mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 02:47:39 +02:00
IcingaHostForm: Fix crashing of form for invalid check command
This commit is contained in:
parent
e37f802cf9
commit
8161a769fe
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Module\Director\Forms;
|
namespace Icinga\Module\Director\Forms;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use Icinga\Exception\AuthenticationException;
|
use Icinga\Exception\AuthenticationException;
|
||||||
use Icinga\Module\Director\Auth\Permission;
|
use Icinga\Module\Director\Auth\Permission;
|
||||||
use Icinga\Module\Director\Auth\Restriction;
|
use Icinga\Module\Director\Auth\Restriction;
|
||||||
@ -83,7 +84,13 @@ class IcingaHostForm extends DirectorObjectForm
|
|||||||
'class' => 'autosubmit',
|
'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', [
|
$this->addBoolean('master_should_connect', [
|
||||||
'label' => $this->translate('Establish connection'),
|
'label' => $this->translate('Establish connection'),
|
||||||
'description' => $this->translate(
|
'description' => $this->translate(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user