From 31d5aef520f8c8b0c971d87ba62963dd0e1fb9f4 Mon Sep 17 00:00:00 2001 From: Chris Penny Date: Thu, 24 Nov 2022 13:18:56 +1300 Subject: [PATCH] Bugfix: SSViewer check object exists before calling prop or method --- src/View/SSViewer_DataPresenter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }