Fix crash when the sort state is empty or not set

This commit is contained in:
UndefinedOffset 2016-11-22 09:34:35 -04:00
parent 29e8996b4a
commit 5d2aa717f3

View File

@ -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);
}