mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 23:55:12 +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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user