diff --git a/src/View/SSViewer_DataPresenter.php b/src/View/SSViewer_DataPresenter.php index 26cdf70c3de..9319f04d383 100644 --- a/src/View/SSViewer_DataPresenter.php +++ b/src/View/SSViewer_DataPresenter.php @@ -355,7 +355,7 @@ protected function getValueSource($property) // Check if the method to-be-called exists on the target object - if so, don't check any further // injection locations $on = $this->itemIterator ? $this->itemIterator->current() : $this->item; - if (isset($on->$property) || method_exists($on, $property ?? '')) { + if ($on && (isset($on->$property) || method_exists($on, $property ?? ''))) { return null; }