I slammed my foot in a heavy door of a 2 door sedan. Because it happened while I was working I did go to the doctor and learned, with an x-ray, that I had a hairline fracture of my big toe. My whole foot was swollen. They taped that toe to the next toe and said that there really isn't anything to be done for a hairline fracture except to keep my foot elevated as much as possible and to ice it for the pain.
I cut the toe out of a tennis shoe and continued with packing and moving. Couldn't have happened at a worse time. That toe was swollen and hurt for a couple of months, I think.
My elderly aunt stepped wrong and had a hairline fracture of one of the bones in her foot. She had osteoporosis. She couldn't walk on the foot. She wore a "boot" like device for a month or so and also stayed off of it with her food elevated most of the time. Again, they found the hairline fracture with x-ray.
If you're concerned about the x-ray, it will be limited to your foot. They may place a lead apron across your abdomen if there is a chance that the x-rays would reach that high. There will be no danger to your baby.
If this were happening to me and the pain were severe enough to take ibuprofen, I'd go to the doctor just to be sure, if I had insurance. Otherwise I might wait a couple of weeks and try staying off the foot.
Either way, you are going to have to keep the foot elevated as much as possible. I don't advise doing what I did which was to stay on my feet. It took months for my foot and toe to heal.