(cherry picked from commit 589a03afcd) Fixes https://gitlab.com/kicad/code/kicad/issues/10275
589a03afcd