Though he’ll get little credit and even less sympathy, there is a case to be made that John Bolton deserves the nation’s thanks for helping save us from at least three Trumpian near-disasters. For a man who held the office of national security adviser for just 1 7 months, this is no mean feat.

Whether it represents an accomplishment is another question.

The first averted disaster would have been an agreement with Kim Jong-un, nearly reached early this year in Hanoi, that would have traded solid U.S. economic and diplomatic concessions for slippery promises of North Korean nuclear disarmament. Presidential sycophants and G.O.P. isolationists would also have cheered the deal, along with more than a few liberals. And Trump would have burnished his self-image as a worthy candidate for a Nobel Peace Prize.

He might have even gotten one. Imagine that.

Yet as with every past North Korean promise of denuclearization, the deal would have been a sham. Bolton stopped it by insisting on the North’s full and complete nuclear disarmament up front, a condition Kim could not accept because his regime cannot survive without its weapons. Bolton called Kim on his bluff and Trump on his illusion — if only for a time. That’s still something.

The second averted disaster would have been a complete withdrawal of U.S. forces from Syria, which Trump abruptly announced in December after a phone call with Turkish strongman Recep Tayyip Erdogan.