1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

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

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