Skip to content

Commit 86ac31c

Browse files
committed
BUGFIX: Preventing an exception when there are no nodes for sorting
1 parent 65381ac commit 86ac31c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/Eel/FlowQueryOperations/SortDataSourceRecursiveByIndexOperation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class SortDataSourceRecursiveByIndexOperation extends AbstractOperation
3636
*/
3737
public function canEvaluate($context)
3838
{
39-
return (isset($context[0]) && ($context[0] instanceof NodeInterface));
39+
return count($context) === 0 || (is_array($context) === true && (current($context) instanceof NodeInterface));
4040
}
4141

4242
/**

0 commit comments

Comments
 (0)