fix(display): check NULL act_screen before using it (#4973)

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
Neo Xu
2023-12-11 21:55:32 +08:00
committed by GitHub
parent aed5502af5
commit 7119b7488b
2 changed files with 31 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
#if LV_BUILD_TEST
#include "../lvgl.h"
#include "unity/unity.h"
void test_screen_load_no_crash(void)
{
/*Delete active screen and load new screen should not crash*/
lv_obj_t * screen = lv_screen_active();
lv_obj_del(screen);
screen = lv_obj_create(NULL);
lv_screen_load(screen);
}
#endif