Skip to content

Commit

Permalink
Merge pull request #1885 from bolt/fix/check-for-content
Browse files Browse the repository at this point in the history
Minor fix: Check if `Content` is set in preview mode.
  • Loading branch information
I-Valchev authored Sep 22, 2020
2 parents 427d8b5 + a83c27a commit da00c25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Entity/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function getTwigValue()
{
$value = $this->getParsedValue();

if (is_string($value) && $this->getDefinition()->get('sanitise')) {
if (is_string($value) && $this->getContent() && $this->getDefinition()->get('sanitise')) {
$value = $this->getContent()->sanitise($value);
}

Expand Down

0 comments on commit da00c25

Please sign in to comment.