From 85c3852b8f1552b029da4caf2395ecf6dd637b6f Mon Sep 17 00:00:00 2001 From: Rummskartoffel Date: Thu, 3 Feb 2022 12:45:06 +0100 Subject: [PATCH] KeyboardPreferenceLoader: Don't crash when "Keymaps" is empty --- Userland/Services/KeyboardPreferenceLoader/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Services/KeyboardPreferenceLoader/main.cpp b/Userland/Services/KeyboardPreferenceLoader/main.cpp index 671dfddfc45..2c035f23a69 100644 --- a/Userland/Services/KeyboardPreferenceLoader/main.cpp +++ b/Userland/Services/KeyboardPreferenceLoader/main.cpp @@ -27,6 +27,8 @@ ErrorOr 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 };