Backport f8177149

Fixes #15702