Dr prescribed me something I'm not meant to take??

Jessica • Baby number one due 17th of feb 2019 ❤️

Went to dr about nausea with pregnancy she prescribed me doxylamine, just went to take one and read the back of the box and it said do not take if breast feeding or pregnant. I'm so conflicted? Why would she prescribe me something she's knows I can't take?