mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 15:28:55 +00:00
LibGUI: Complain about malformed "layout" values in JSON GUI
This commit is contained in:
parent
aa3c28957a
commit
6590eb8eb7
Notes:
sideshowbarker
2024-07-19 02:25:35 +09:00
Author: https://github.com/awesomekling
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