mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-05-28 04:35:53 -04:00
IcingaObjectFieldLoader: do not fail on emtpy...
...parents
This commit is contained in:
parent
9e977eaf9a
commit
e04acbc55f
1 changed files with 8 additions and 7 deletions
|
|
@ -146,16 +146,17 @@ class IcingaObjectFieldLoader
|
|||
|
||||
protected function loadDataFieldsForObjects($objectList)
|
||||
{
|
||||
if (empty($objectList)) {
|
||||
// Or should we fail?
|
||||
return array();
|
||||
}
|
||||
|
||||
$ids = array();
|
||||
$objects = array();
|
||||
foreach ($objectList as $object) {
|
||||
$ids[] = $object->id;
|
||||
$objects[$object->id] = $object;
|
||||
if ($object->hasBeenLoadedFromDb()) {
|
||||
$ids[] = $object->id;
|
||||
$objects[$object->id] = $object;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($ids)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$connection = $object->getConnection();
|
||||
|
|
|
|||
Loading…
Reference in a new issue