The Truth-Teller and the Liar-breain teaser

Riddle
You are on an island with two tribes. One tribe always tells the truth, and the other always lies. You come across two people from the island. One is from the truth-telling tribe, and the other from the lying tribe, but you don't know who is by who. You can ask only one question to either person to determine which path leads to safety. What do you ask?

    Answer: Ask either person, "If I asked the other person which path leads to safety, what would they say?" Then take the opposite path. A truth-teller will point to the wrong path if asked what the liar would say, and a liar will also point to the wrong path if asked what the truth-teller would say.