dodge a bullet
US /dɑdʒ ə ˈbʊlɪt/
UK /dɑdʒ ə ˈbʊlɪt/

1.
to narrowly avoid a dangerous or unpleasant situation
:
•
I really dodged a bullet when I missed that flight, as it later crashed.
•
She thought she was going to be fired, but she dodged a bullet when the company decided to downsize a different department.