Merge "Fix nullptr exception when using do-while" into main