Fixes #20192 (closed)
/CC @cvrebert
PS. We should probable backport in master. I can do it later, just let me know.