On the opposite side of the situation, I've had a girl come up to me at a bar, ask me for a cigarette, and during the process of telling her I'm out of smokes, her manlet chode boyfriend came up from behind me, puts his hand on my shoulder and was like, "Nice try bro, she's taken. Better luck next time!"
I can imagine a bunch of autistic boyfriends misreading situations like this and instantly cheap shotting an innocent guy, so be sure to properly assess* the situation (if it's strictly verbal) before beating up (or doucheing out) on someone you think is hitting on your girlfriend. If it's physical like OPs situation then yea that's a green light to intervene.