diff --git a/src/IslandoraUtils.php b/src/IslandoraUtils.php index 41fd44ba..23b5f0d3 100644 --- a/src/IslandoraUtils.php +++ b/src/IslandoraUtils.php @@ -107,10 +107,13 @@ class IslandoraUtils { if ($field->isEmpty()) { return NULL; } - return $field->first() + $parent = $field->first() ->get('entity') - ->getTarget() - ->getValue(); + ->getTarget(); + if (!is_null($parent)) { + return $parent->getValue(); + } + return NULL; } /**