mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX Ensure tmpItem has a value before calling method_exists on it
This commit is contained in:
parent
8a73a4ad22
commit
a3d9648687
@ -146,7 +146,7 @@ class GridFieldSortableHeader implements GridField_HTMLProvider, GridField_DataM
|
|||||||
if ($tmpItem instanceof SS_List) {
|
if ($tmpItem instanceof SS_List) {
|
||||||
// It's impossible to sort on a HasManyList/ManyManyList
|
// It's impossible to sort on a HasManyList/ManyManyList
|
||||||
break;
|
break;
|
||||||
} elseif (method_exists($tmpItem, 'hasMethod') && $tmpItem->hasMethod($methodName)) {
|
} elseif ($tmpItem && method_exists($tmpItem, 'hasMethod') && $tmpItem->hasMethod($methodName)) {
|
||||||
// The part is a relation name, so get the object/list from it
|
// The part is a relation name, so get the object/list from it
|
||||||
$tmpItem = $tmpItem->$methodName();
|
$tmpItem = $tmpItem->$methodName();
|
||||||
} elseif ($tmpItem instanceof DataObject
|
} elseif ($tmpItem instanceof DataObject
|
||||||
|
Loading…
x
Reference in New Issue
Block a user