dodge a bullet
To narrowly avoid something or some situation that turns out to be undesirable, disastrous, dangerous, or otherwise harmful. A: "I heard that John has become a drug addict and is living out of his car. Didn't you two used to date?" B: "Yeah, but we broke up about five years ago. Looks like I dodged a bullet on that one." I really dodged the bullet when my exam was postponed to next week, as I hadn't studied for it at all!
get (the hell) out of Dodge
To leave or depart from a place, especially quickly or with marked urgency. A reference to Dodge City, Kansas, the clichéd setting of cowboy and western films from the early to mid-1900s. It looks like things are getting pretty tense in here, let's get out of Dodge! With our creditors becoming increasingly aggressive, we decided to just get the hell out of Dodge and leave it all behind.