fix(obj_style): prevent access to class null pointer (#3252)

Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech
2022-04-11 12:43:52 +02:00
committed by GitHub
co-authored by pengyiqiang
parent 563603589d
commit 3db7adffb1
+6 -1
View File
@@ -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);