If you ask me, it should be pretty darn difficult to win a "sexual harassment" lawsuit against somebody if you willingly and consensually had sex with 'em both before and after the alleged harassment.
If you were in a relationship before (that included sex), then broke off the relationship, then were harassed into more sex afterward, that's still a criminal act of sexual harassment.