Skip to content

Commit

Permalink
Bugfix: SSViewer check object exists before calling prop or method
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispenny committed Nov 24, 2022
1 parent dc98cad commit 31d5aef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/View/SSViewer_DataPresenter.php
Expand Up @@ -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;
}

Expand Down

0 comments on commit 31d5aef

Please sign in to comment.