As far as I can see the if condition in line 113-114 ensures that the node is inside of the raster. So the comment is somewhat misleading.