diff --git a/src/Picqer/Carriers/SendCloud/Query/FindAll.php b/src/Picqer/Carriers/SendCloud/Query/FindAll.php index 84a292d..2b035a2 100644 --- a/src/Picqer/Carriers/SendCloud/Query/FindAll.php +++ b/src/Picqer/Carriers/SendCloud/Query/FindAll.php @@ -25,11 +25,16 @@ public function collectionFromResult($result) { $collection = []; - foreach ($result[$this->namespaces['plural']] as $r) { - $collection[] = new self($this->connection(), $r); + $resultsContainer = $result; + if (isset($result[$this->namespaces['plural']])) { + $resultsContainer = $result[$this->namespaces['plural']]; + } + + foreach ($resultsContainer as $item) { + $collection[] = new self($this->connection(), $item); } return $collection; } -} \ No newline at end of file +}