mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +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
Notes:
sideshowbarker
2024-07-18 16:56:59 +09:00
Author: https://github.com/NonStandardModel
Commit: 5bbca2fa8b
Pull-request: https://github.com/SerenityOS/serenity/pull/7700
Reviewed-by: https://github.com/linusg
1 changed files with 4 additions and 1 deletions
|
@ -126,7 +126,10 @@ void KeyboardMapperWidget::create_frame()
|
||||||
void KeyboardMapperWidget::load_from_file(String filename)
|
void KeyboardMapperWidget::load_from_file(String filename)
|
||||||
{
|
{
|
||||||
auto result = Keyboard::CharacterMapFile::load_from_file(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_filename = filename;
|
||||||
m_character_map = result.value();
|
m_character_map = result.value();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue