Check that included array exists (#132)

This commit is contained in:
Sami Mazouz 2021-05-17 21:16:00 +01:00 committed by GitHub
parent 95fc846c04
commit a6695e10cd

View File

@ -82,7 +82,7 @@ class Tag
$tagsDocument = $this->getTagsDocument($request, $slug);
$apiDocument->included[] = $tagsDocument->data;
$includedTags = $tagsDocument->included;
$includedTags = $tagsDocument->included ?? [];
foreach ((array) $includedTags as $includedTag) {
$apiDocument->included[] = $includedTag;
}