We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fddabc2 + 36a8fdf commit 26bc8b8Copy full SHA for 26bc8b8
src/Resources/Product.php
@@ -29,15 +29,19 @@ public function getList($query = [])
29
try {
30
$products = $this->resourceClient->getResources($query);
31
32
- $this->cacheWrapper->storeCachedList($products, $query);
33
- return $products;
+ if (is_array($products)) {
+ $this->cacheWrapper->storeCachedList($products, $query);
34
+ return $products;
35
+ } else {
36
+ return [];
37
+ }
38
} catch (DpdException $e) {
39
$result = $this->cacheWrapper->getCachedList($query, true); //a year
40
41
// So we had a failure save cache now for an hour
42
$this->cacheWrapper->storeCachedList($result, $query);
43
- if ($result) {
44
+ if ($result && is_array($result)) {
45
return $result;
46
}
47
return [];
0 commit comments