Fixes #29346 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> (cherry picked from commit 553d46e6f6a144905266d58315a2b0ff2e976380)