fix: Undefined array key 'id'

This commit is contained in:
Guillermo Pages
2021-09-01 09:49:27 +02:00
parent 36b243e0d4
commit 88d8ceed0b

View File

@@ -179,6 +179,7 @@ class BookSearch
$books = array(); $books = array();
if(isset($results['response']['docs']) && is_array($results['response']['docs'])) { if(isset($results['response']['docs']) && is_array($results['response']['docs'])) {
foreach($results['response']['docs'] as $r) { foreach($results['response']['docs'] as $r) {
if (!isset($r['id'])) continue;
$books[$r['id']] = $r; $books[$r['id']] = $r;
} }
} }