mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
LibGUI: Complain about malformed "layout" values in JSON GUI
This commit is contained in:
@@ -949,6 +949,10 @@ bool Widget::load_from_json(const JsonObject& json)
|
||||
set_preferred_size(preferred_width.to_i32(), preferred_size().height());
|
||||
|
||||
auto layout_value = json.get("layout");
|
||||
if (!layout_value.is_null() && !layout_value.is_object()) {
|
||||
dbg() << "layout is not an object";
|
||||
return false;
|
||||
}
|
||||
if (layout_value.is_object()) {
|
||||
auto& layout = layout_value.as_object();
|
||||
auto class_name = layout.get("class");
|
||||
|
||||
Reference in New Issue
Block a user