Fix crash when running SumNeighbours algorithm.

Refs #10037.
Merge branch 'feature/10037_crash_on_sum_neighbours' into develop