mirror of
https://github.com/lvgl/lvgl.git
synced 2026-08-18 02:38:01 +08:00
fix(obj_style): prevent access to class null pointer (#3252)
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
co-authored by
pengyiqiang
parent
563603589d
commit
3db7adffb1
@@ -241,7 +241,12 @@ lv_style_value_t lv_obj_get_style_prop(const lv_obj_t * obj, lv_part_t part, lv_
|
||||
cls = cls->base_class;
|
||||
}
|
||||
|
||||
value_act.num = prop == LV_STYLE_WIDTH ? cls->width_def : cls->height_def;
|
||||
if(cls) {
|
||||
value_act.num = prop == LV_STYLE_WIDTH ? cls->width_def : cls->height_def;
|
||||
}
|
||||
else {
|
||||
value_act.num = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
value_act = lv_style_prop_get_default(prop);
|
||||
|
||||
Reference in New Issue
Block a user