IDIOMS

to have a close shave

Example: He had a close shave when he almost fell off the ladder.