mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Bugfix: SSViewer check object exists before calling prop or method
This commit is contained in:
parent
dc98cad48a
commit
31d5aef520
@ -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
|
// Check if the method to-be-called exists on the target object - if so, don't check any further
|
||||||
// injection locations
|
// injection locations
|
||||||
$on = $this->itemIterator ? $this->itemIterator->current() : $this->item;
|
$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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user