From cc1d1884dbcbb1bffae6760b2e2d828c88012904 Mon Sep 17 00:00:00 2001 From: Michal Kleiner Date: Sun, 1 Mar 2020 00:22:01 +1300 Subject: [PATCH] Add safe-guard before adding decorated tagged dataobject to the list --- src/Models/TaxonomyTerm.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Models/TaxonomyTerm.php b/src/Models/TaxonomyTerm.php index 793d962..0a649b5 100644 --- a/src/Models/TaxonomyTerm.php +++ b/src/Models/TaxonomyTerm.php @@ -1108,7 +1108,9 @@ public function getTaggedDataObjects(): ArrayList $relationName = $relation; } - $list->push(self::decorateTaggedDataObject($owner, $fieldName, $relationName)); + if ($owner && $owner->exists()) { + $list->push(self::decorateTaggedDataObject($owner, $fieldName, $relationName)); + } }); } }