It is commonly said that getting an X-ray during pregnancy can harm your baby and while it might be true, actually not getting one can harm you. So, in short, this statement can be considered partially true.
According to the American Academy of Family Physicians (AAFP), X-rays are considered safe during pregnancy, but it is true that they should only be done when absolutely necessary.
Moreover, the American College of Radiology (ACR) states that there is no diagnostic X-ray with a radiation dose so significant as to cause negative side effects in a developing embryo/fetus.
Suggested for you: Pregnancy Stages by Month – Fetal Development with Pictures.