1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 08:35:09 +00:00

LibGUI: Make the GML parser a bit more fault-tolerant

It will now fail and whine in the debug log instead of asserting.
This commit is contained in:
Andreas Kling 2020-12-20 14:28:41 +01:00
parent 64ba41ea13
commit 6e0976d858
2 changed files with 46 additions and 18 deletions

View file

@ -936,7 +936,8 @@ void Widget::set_override_cursor(Gfx::StandardCursor cursor)
bool Widget::load_from_gml(const StringView& gml_string)
{
auto value = parse_gml(gml_string);
ASSERT(value.is_object());
if (!value.is_object())
return false;
return load_from_json(value.as_object());
}