Browse Source

Check for the parent before we getValue (#95)

pull/756/head
Jared Whiklo 6 years ago committed by dannylamb
parent
commit
eb906c93bd
  1. 9
      src/IslandoraUtils.php

9
src/IslandoraUtils.php

@ -107,10 +107,13 @@ class IslandoraUtils {
if ($field->isEmpty()) { if ($field->isEmpty()) {
return NULL; return NULL;
} }
return $field->first() $parent = $field->first()
->get('entity') ->get('entity')
->getTarget() ->getTarget();
->getValue(); if (!is_null($parent)) {
return $parent->getValue();
}
return NULL;
} }
/** /**

Loading…
Cancel
Save