fix(disp): fix missing null pointer judgment (#3238)
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
@@ -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)
|
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;
|
disp->theme = th;
|
||||||
|
|
||||||
if(disp->screen_cnt == 3 &&
|
if(disp->screen_cnt == 3 &&
|
||||||
|
|||||||
Reference in New Issue
Block a user