IcingaObjectFieldLoader: do not fail on emtpy...

...parents
This commit is contained in:
Thomas Gelf 2016-10-14 08:33:58 +00:00
parent 9e977eaf9a
commit e04acbc55f

View File

@ -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();