IcingaServiceSet: do not delete Services w/o id

This commit is contained in:
Thomas Gelf 2022-09-20 07:20:29 +02:00
parent 166b862114
commit 8b1513830c

View File

@ -278,7 +278,9 @@ class IcingaServiceSet extends IcingaObject implements ExportInterface
if ($hostId) {
$deleteIds = [];
foreach ($this->getServiceObjects() as $service) {
$deleteIds[] = (int) $service->get('id');
if ($idToDelete = $service->get('id')) {
$deleteIds[] = (int) $idToDelete;
}
}
if (! empty($deleteIds)) {