IcingaCommandArgument: be defensive, format could

...be missing

fixes #1151
This commit is contained in:
Thomas Gelf 2017-09-05 10:22:01 +02:00
parent 7cd307ea53
commit 9cfc6bb46d
1 changed files with 6 additions and 1 deletions

View File

@ -96,9 +96,14 @@ class IcingaCommandArgument extends IcingaObject
protected function transformPlainArgumentValue($plain)
{
if (property_exists($plain, 'argument_value')) {
if (property_exists($plain, 'argument_format')) {
$format = $plain->argument_format;
} else {
$format = 'string';
}
$plain->value = $this->makePlainArgumentValue(
$plain->argument_value,
$plain->argument_format
$format
);
unset($plain->argument_value);
unset($plain->argument_format);