From 4e78e91bc21b966c6abe85e334f3376ac59f9717 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 16 Apr 2024 12:18:35 +0200 Subject: [PATCH] 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 --- repos/gems/src/app/sculpt_manager/view/settings_widget.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repos/gems/src/app/sculpt_manager/view/settings_widget.h b/repos/gems/src/app/sculpt_manager/view/settings_widget.h index e96356bd7b..a787e75b6c 100644 --- a/repos/gems/src/app/sculpt_manager/view/settings_widget.h +++ b/repos/gems/src/app/sculpt_manager/view/settings_widget.h @@ -114,7 +114,8 @@ struct Sculpt::Settings_widget : Widget [&] { _selected_section = Selected_section::NONE; }, [&] (Clicked_at const &at) { Id const id = at.matching_id(); - action.select_keyboard_layout(id.value); + if (id.valid()) + action.select_keyboard_layout(id.value); }); } };