Added null check to ConnectionPathfinder