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]; }