IcingaObjectFilterHelper: do not fail with no...

...involved parents (indirect inheritance with no child template)
This commit is contained in:
Thomas Gelf 2017-07-14 15:19:05 +02:00
parent d61b93d63d
commit 9f96b1d31b
1 changed files with 5 additions and 1 deletions

View File

@ -70,7 +70,11 @@ class IcingaObjectFilterHelper
$ids[] = $template->getAutoincId();
}
$sub->where("$i.parent_${type}_id IN (?)", $ids);
if (empty($ids)) {
$sub->where('(1 = 0)');
} else {
$sub->where("$i.parent_${type}_id IN (?)", $ids);
}
} else {
throw new ProgrammingError(
'Unable to understand "%s" inheritance',