Leg cramps

I'm 20 weeks and have had really bad leg cramps. It makes it hard to sleep at night. Any advice?