summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorNonStandardModel <33322918+NonStandardModel@users.noreply.github.com>2021-06-03 17:19:07 +0200
committerGitHub <noreply@github.com>2021-06-03 16:19:07 +0100
commit5bbca2fa8badb4f6eaa6112856ff119480a900ff (patch)
treefa38ad1e2c3a904e09c9e91810ee0a91ebe2f770 /Userland/Applications
parent47c1a31f89a83f9120ab2d7994f5c207cade8b2a (diff)
downloadserenity-5bbca2fa8badb4f6eaa6112856ff119480a900ff.zip
KeyboardMapper: Fix crash upon loading an invalid JSON file
This fixes #7699. It would be nice to also show a GUI alert informing about the failure, but I will leave that for the future.
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp
index dba547022b..77322956b8 100644
--- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp
+++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp
@@ -126,7 +126,10 @@ void KeyboardMapperWidget::create_frame()
void KeyboardMapperWidget::load_from_file(String filename)
{
auto result = Keyboard::CharacterMapFile::load_from_file(filename);
- VERIFY(result.has_value());
+ if (!result.has_value()) {
+ dbgln("Failed to load character map from file {}", filename);
+ return;
+ }
m_filename = filename;
m_character_map = result.value();