diff --git a/src/Renderer.php b/src/Renderer.php index aae8d63..072d380 100644 --- a/src/Renderer.php +++ b/src/Renderer.php @@ -126,11 +126,13 @@ protected function renderContent(): string return ''; } - if (! $this->fieldValue) { - $this->fieldValue = $this->entry->augmentedValue($this->fieldHandle); + // make sure we definitely have field data + // (might be a problem with e. g. old content files) + if (! $this->fieldValue && ! $this->fieldValue = $this->entry->augmentedValue($this->fieldHandle)) { + return ''; } - $fieldtype = $this->fieldValue->field()->fieldtype(); + $fieldtype = $this->fieldValue->field()?->fieldtype(); if ($fieldtype instanceof Bard) { return $this->renderBard($fieldtype);