mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
IcingaHostForm: Fix crashing of form for invalid check command (#2941)
fixes #2854
This commit is contained in:
commit
32a644fad8
@ -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 @@ class IcingaHostForm extends DirectorObjectForm
|
||||
'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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user