mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
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.
This commit is contained in:
parent
47c1a31f89
commit
5bbca2fa8b
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue