sculpt: sanitize keyboard-layout choice

The check handles the case when the user clicks right of the
radio-button text, yielding an invalid "matching" id. This should not
result in any action.

Issue #5174
This commit is contained in:
Norman Feske 2024-04-16 12:18:35 +02:00 committed by Christian Helmuth
parent e1ab69491c
commit 4e78e91bc2

View File

@ -114,7 +114,8 @@ struct Sculpt::Settings_widget : Widget<Vbox>
[&] { _selected_section = Selected_section::NONE; }, [&] { _selected_section = Selected_section::NONE; },
[&] (Clicked_at const &at) { [&] (Clicked_at const &at) {
Id const id = at.matching_id<Keyboard_radio>(); Id const id = at.matching_id<Keyboard_radio>();
action.select_keyboard_layout(id.value); if (id.valid())
action.select_keyboard_layout(id.value);
}); });
} }
}; };