return empty array in FroxlorAPI.php example class if last call was unsuccessful, fixes #722

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-10-08 17:36:42 +02:00
parent 20699a15a6
commit 89b95d61d2

View File

@@ -148,6 +148,11 @@ class FroxlorAPI
*/
public function getLastResponse(): array
{
if (!empty($this->getLastError())) {
// nothing is returned when the last call
// was not successful
return [];
}
return $this->last_body;
}