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) {
|
||||
// It's impossible to sort on a HasManyList/ManyManyList
|
||||
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
|
||||
$tmpItem = $tmpItem->$methodName();
|
||||
} elseif ($tmpItem instanceof DataObject
|
||||
|
|
Loading…
Reference in New Issue