Checking for path finding before moving a bot

I have a function that makes the bot randomly move from 1 point to another.

Is there a way to check if the point generated is inside the bound of the navmesh and order to make the bot after that?