IcingaObjectFieldForm: gracefully handle missing...

...field, as it might have been removed before

refs #751
This commit is contained in:
Thomas Gelf 2017-01-26 09:03:51 +01:00
parent d323a77695
commit 1a6fbd5cd7
1 changed files with 7 additions and 2 deletions

View File

@ -62,8 +62,13 @@ class IcingaObjectFieldForm extends DirectorObjectForm
foreach ($m[1] as $val) {
if (array_key_exists($val, $blacklistedVars)) {
$id = $blacklistedVars[$val];
$suggestedFields[$id] = $existingFields[$id];
unset($existingFields[$id]);
// Hint: if not set it might already have been
// removed in this loop
if (array_key_exists($id, $existingFields)) {
$suggestedFields[$id] = $existingFields[$id];
unset($existingFields[$id]);
}
} else {
$argumentVars[$val] = $val;
$argumentVarDescriptions[$val] = $arg->description;