Fix exception when the response from the Icinga 2 API has an empty result set
fixes #2805
This commit is contained in:
parent
f7a8cf8a6e
commit
7a2d8eda8d
|
@ -215,7 +215,9 @@ class ApiCommandTransport implements CommandTransportInterface
|
|||
);
|
||||
}
|
||||
$result = array_pop($response['results']);
|
||||
if ($result['code'] < 200 || $result['code'] >= 300) {
|
||||
if (! empty($result)
|
||||
&& ($result['code'] < 200 || $result['code'] >= 300)
|
||||
) {
|
||||
throw new CommandTransportException(
|
||||
'Can\'t send external Icinga command: %u %s',
|
||||
$result['code'],
|
||||
|
|
Loading…
Reference in New Issue