Skip to content

Commit

Permalink
[TM-1539] add validation for relationships in linked fields that are …
Browse files Browse the repository at this point in the history
…not iterables
  • Loading branch information
pachonjcl committed Dec 4, 2024
1 parent 7e29a10 commit 5e5d66c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Models/Traits/UsesLinkedFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private function mapValue($model, string $property, array $linkedFieldInfo)
if (empty($resource)) {
return $model->$relation;
}
if (empty($model->$relation)) {
if (empty($model->$relation) || !is_iterable($model->$relation)) {
return [];
}

Expand Down

0 comments on commit 5e5d66c

Please sign in to comment.