Skip to content

Commit

Permalink
BUGFIX: Preventing an exception when there are no nodes for sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
jobee committed Apr 21, 2022
1 parent 65381ac commit 86ac31c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SortDataSourceRecursiveByIndexOperation extends AbstractOperation
*/
public function canEvaluate($context)
{
return (isset($context[0]) && ($context[0] instanceof NodeInterface));
return count($context) === 0 || (is_array($context) === true && (current($context) instanceof NodeInterface));
}

/**
Expand Down

0 comments on commit 86ac31c

Please sign in to comment.