Skip to content

Commit

Permalink
Merge pull request #32 from Nattfarinn/master
Browse files Browse the repository at this point in the history
(WIP) EZP-24779 fix: prevent error if image is related to non-existing object
  • Loading branch information
andrerom committed Sep 16, 2015
2 parents 09b1922 + 30c3eff commit d6ef984
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Rest/Field/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ private function getImageFieldIdentifier($contentId, $language, $related = false
} elseif (in_array('ezobjectrelation', $fieldDefinitions) && !$related) {
$field = $content->getFieldValue($fieldNames['ezobjectrelation'], $language);

return $this->getImageFieldIdentifier($field->destinationContentId, $language, true);
if (!empty($field->destinationContentId)) {
return $this->getImageFieldIdentifier($field->destinationContentId, $language, true);
}
} else {
return $this->getConfiguredFieldIdentifier('image', $contentType);
}
Expand Down

0 comments on commit d6ef984

Please sign in to comment.