(cherry picked from commit f648c000bd)
f648c000bd
Fixes #6171. (cherry picked from commit 8e14647759)
8e14647759