summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRummskartoffel <Rummskartoffel@protonmail.com>2022-02-03 12:45:06 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-03 14:57:46 +0100
commit85c3852b8f1552b029da4caf2395ecf6dd637b6f (patch)
treebe21046726a6e4468bb540ce13fc36915e759ec8
parent2b14a112381ac945b5c6d66829e622b1db257214 (diff)
downloadserenity-85c3852b8f1552b029da4caf2395ecf6dd637b6f.zip
KeyboardPreferenceLoader: Don't crash when "Keymaps" is empty
-rw-r--r--Userland/Services/KeyboardPreferenceLoader/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Services/KeyboardPreferenceLoader/main.cpp b/Userland/Services/KeyboardPreferenceLoader/main.cpp
index 671dfddfc4..2c035f23a6 100644
--- a/Userland/Services/KeyboardPreferenceLoader/main.cpp
+++ b/Userland/Services/KeyboardPreferenceLoader/main.cpp
@@ -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 };