Fixes #10473 https://gitlab.com/kicad/code/kicad/issues/10473 (cherry picked from commit 380cb452b2)
380cb452b2