fix(disp): fix missing null pointer judgment (#3238)

Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech
2022-03-30 18:59:26 +08:00
committed by GitHub
parent 80a6d2bf57
commit e4fb579558

View File

@@ -136,7 +136,12 @@ lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp)
*/
void lv_disp_set_theme(lv_disp_t * disp, lv_theme_t * th)
{
if(disp == NULL) disp = lv_disp_get_default();
if(!disp) disp = lv_disp_get_default();
if(!disp) {
LV_LOG_WARN("no display registered");
return;
}
disp->theme = th;
if(disp->screen_cnt == 3 &&