Fix for crash if nodesNBodies array empty.

Minor change to prevent an exception being thrown if the nodesNBodies array has 0 objects.