fix apsp
fixes an error that leads to an ArrayOutOfBoundsException when trying to truncate an empty array