Fixes #51677. Co-authored-by: Arkadiusz Marcin Kołek <aksoftware91@gmail.com> (cherry picked from commit 6f4858f184)
6f4858f184