IcingaApiCommandRenderer: Don't set empty array, if no attr is set

- Use the returned value instead, either array or null.

- With https://github.com/Icinga/icinga2/issues/8167 attrs=[] means that no attrs are
  fetched at all, and attrs=null means that all available attrs are fetched
This commit is contained in:
Sukhwinder Dhillon 2025-05-27 14:39:49 +02:00 committed by Johannes Meyer
parent 815236eceb
commit a7afaf71f2

View file

@ -127,7 +127,7 @@ class IcingaApiCommandRenderer implements IcingaCommandRendererInterface
{
$data = [
'all_joins' => 1,
'attrs' => $command->getAttributes() ?: []
'attrs' => $command->getAttributes()
];
$endpoint = 'objects/' . $this->getObjectPluralType($this->applyFilter($data, $command->getObjects()));