Backport #25246 by @wolfogre Fix #25245. Regression of #23946. Co-authored-by: Jason Song <i@wolfogre.com>