KeyboardPreferenceLoader: Don't crash when "Keymaps" is empty

This commit is contained in:
Rummskartoffel 2022-02-03 12:45:06 +01:00 committed by Andreas Kling
parent 2b14a11238
commit 85c3852b8f
Notes: sideshowbarker 2024-07-17 19:51:44 +09:00

View file

@ -27,6 +27,8 @@ ErrorOr<int> serenity_main(Main::Arguments)
auto keymaps = mapper_config->read_entry("Mapping", "Keymaps", "");
auto keymaps_vector = keymaps.split(',');
if (keymaps_vector.size() == 0)
exit(1);
pid_t child_pid;
const char* argv[] = { "/bin/keymap", "-m", keymaps_vector.first().characters(), nullptr };