Well, the obvious way to prevent that is to get to know them before declaring yourself a couple. If you just randomly decide to date someone online without knowing anything about them or having actually seen what they look like, then I'm afraid that you're being a very, very foolish person.
I knew Feliciano for a year and a half before we started dating. I knew what she looked like and how old she was. And it was an internet relationship.
Sure, it's always a risk dating someone over the internet long-distance. But it's also a risk dating someone in real life. People are never what you perceive them to be at first. Always remember that.