It's possible to fall through the loops above with node still nil. This catches this and reports an error. Found this working on #27819.
It's possible to fall through the loops above with node still nil. This catches this and reports an error. Found this working on #27819.