From 12e83deece9a01d98293c76b7de061304026e783 Mon Sep 17 00:00:00 2001 From: y5nw Date: Fri, 11 Jul 2025 17:57:33 +0200 Subject: [PATCH] Fix segfault with touch controls --- src/gui/touchcontrols.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/touchcontrols.cpp b/src/gui/touchcontrols.cpp index c6a6d8b88e..a22a9448c5 100644 --- a/src/gui/touchcontrols.cpp +++ b/src/gui/touchcontrols.cpp @@ -213,9 +213,11 @@ static KeyPress id_to_keypress(touch_gui_button_id id) assert(!setting_name.empty()); const auto &keylist = getKeySetting(setting_name); - if (keylist.empty()) + if (keylist.empty()) { warningstream << "TouchControls: Unbound or invalid key for " << setting_name << ", hiding button." << std::endl; + return KeyPress(); + } return keylist[0]; }