mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibKeyboard: Don't crash when file is empty
Just return empty map, like when file error occurs.
This commit is contained in:
committed by
Andreas Kling
parent
53573f6fb1
commit
48cd26f12d
@@ -50,7 +50,8 @@ Optional<CharacterMapData> CharacterMapFile::load_from_file(const String& file_n
|
||||
|
||||
auto file_contents = file->read_all();
|
||||
auto json_result = JsonValue::from_string(file_contents);
|
||||
ASSERT(json_result.has_value());
|
||||
if (!json_result.has_value())
|
||||
return {};
|
||||
auto json = json_result.value().as_object();
|
||||
|
||||
Vector<u32> map = read_map(json, "map");
|
||||
|
||||
Reference in New Issue
Block a user