mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
Fix crash when the sort state is empty or not set
This commit is contained in:
parent
29e8996b4a
commit
5d2aa717f3
@ -118,7 +118,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
|
||||
|
||||
$headerState = $gridField->State->GridFieldSortableHeader;
|
||||
$state = $gridField->State->GridFieldSortableRows;
|
||||
if ((!is_bool($state->sortableToggle) || $state->sortableToggle==false) && $headerState && !empty($headerState->SortColumn)) {
|
||||
if ((!is_bool($state->sortableToggle) || $state->sortableToggle==false) && $headerState && !empty($headerState->SortColumn) && (is_string($headerState->SortColumn) || is_array($headerState->SortColumn))) {
|
||||
return $dataList->sort($headerState->SortColumn);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user