Check that the population has a size, otherwise ga_get_entity_from_rank() will return NULL and of course will crash because NULL doesn't have a fitness field