diff --git a/src/Service/BookSuggestions.php b/src/Service/BookSuggestions.php index 50d58039..2744cebb 100644 --- a/src/Service/BookSuggestions.php +++ b/src/Service/BookSuggestions.php @@ -53,7 +53,7 @@ public function getCategorySuggestions(Book $book): array return $suggestions; } foreach ($results['docs'] as $result) { - if(is_array($result['subject'])){ + if(array_key_exists('subject',$result) && is_array($result['subject'])){ foreach ($result['subject'] as $category) { $suggestions['tags'][$category] = $category; }