How to check path closed

when path closed, how to check it? AStar ran smoothly when path had closed in my project.
Like this:

when path closed, the line is straight, acrossed all obstacles. I want Astar to give me a message that not true.

up this paht is open, Astar ran normally.

so i have a question how to check path closed?

I got it,select ‘Interpolate’ in seeker script