Merge pull request #10589 from silverstripe-terraformers/pulls/runtemplate-fix

This commit is contained in:
Michal Kleiner 2022-11-24 13:49:35 +13:00 committed by GitHub
commit f57a77dcdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -355,7 +355,7 @@ class SSViewer_DataPresenter extends SSViewer_Scope
// 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;
}