From d4a50d6de1f9858f0215fa9bc7c81aec3a5ac98b Mon Sep 17 00:00:00 2001 From: r-garrido Date: Thu, 22 Jun 2023 13:23:04 +0200 Subject: [PATCH] ensure return is an array --- src/RDWOpenData/RDW.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/RDWOpenData/RDW.php b/src/RDWOpenData/RDW.php index 9c6e0e1..7e636f3 100644 --- a/src/RDWOpenData/RDW.php +++ b/src/RDWOpenData/RDW.php @@ -55,9 +55,10 @@ protected static function mergeOutput(array $data, array $output, string $endpoi $data['as_' . $output_as['as_nummer'] . '_' . $item] = $value; } } - } else { - $data = array_merge($data, $output[0]) ?? []; + } else if(isset($output[0]) && is_array($output[0])) { + $data = array_merge($data, $output[0]); } + return $data; }