Follow-up for 888f65ac. Hopefully fixes #20514. (cherry picked from commit 93413acd)
mentioned in commit 2d388e6c