AI travel distance to point

I have an AI that will calculate points around himself in a radius to move to. This works great, but If the closest point is on the other side of a wall the distance that the AI has to walk to reach the point may actually be the farthest of all the points.

Is there a way to find the actual distance the AI has to walk to reach a point?
EpEp