mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 19:34:59 +00:00
LibGUI: Complain about malformed "layout" values in JSON GUI
This commit is contained in:
parent
aa3c28957a
commit
6590eb8eb7
1 changed files with 4 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue