Fix #9317

(cherry picked from commit f140ff2443b9f1a92b32e93997e0f1325fccd2d8)