From dd26117b59bab49a09aa5610ad8f33cc6b30a4f2 Mon Sep 17 00:00:00 2001 From: Sergio Mendolia Date: Fri, 13 Oct 2023 23:58:52 +0200 Subject: [PATCH] add check --- src/Service/BookSuggestions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }