Skip to content

Commit

Permalink
add check
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMendolia committed Oct 13, 2023
1 parent b87fed4 commit dd26117
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Service/BookSuggestions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit dd26117

Please sign in to comment.