Check if variable is not empty before checking if the path exists.