The fix from the 1.18 branch accidentally got reverted when landing into trunk, so it needs to be restored.
The fix from the 1.18 branch accidentally got reverted when landing into trunk, so it needs to be restored.