fix crash on farthest point when layer empty