Fixes #14566 (cherry picked from commit c1566ef0) (cherry picked from commit b7f2308b)
mentioned in commit e641811c