Leg cramp during orgasm.

Just had amazing sex with my husband, me on the bed on my back, him standing, my legs up on his shoulders. When I get off, I ALWAYS straighten my legs out involuntarily. Normally not a problem, but this time, I had the worst leg cramp. I literally cried out in pain and was crying after. And it still hurts so bad. I'm 23 weeks pregnant. Normal? How to prevent it from happening?