1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Fix segfault with touch controls

This commit is contained in:
y5nw 2025-07-11 17:57:33 +02:00
parent 6faa33459d
commit 12e83deece

View file

@ -213,9 +213,11 @@ static KeyPress id_to_keypress(touch_gui_button_id id)
assert(!setting_name.empty()); assert(!setting_name.empty());
const auto &keylist = getKeySetting(setting_name); const auto &keylist = getKeySetting(setting_name);
if (keylist.empty()) if (keylist.empty()) {
warningstream << "TouchControls: Unbound or invalid key for " warningstream << "TouchControls: Unbound or invalid key for "
<< setting_name << ", hiding button." << std::endl; << setting_name << ", hiding button." << std::endl;
return KeyPress();
}
return keylist[0]; return keylist[0];
} }