mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix(sdl): check against NULL before using the driver data of a display (#6799)
This commit is contained in:
parent
caa09a1564
commit
91d64b1042
@ -166,7 +166,7 @@ lv_display_t * lv_sdl_get_disp_from_win_id(uint32_t win_id)
|
|||||||
|
|
||||||
while(disp) {
|
while(disp) {
|
||||||
lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
|
lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
|
||||||
if(SDL_GetWindowID(dsc->window) == win_id) {
|
if(dsc != NULL && SDL_GetWindowID(dsc->window) == win_id) {
|
||||||
return disp;
|
return disp;
|
||||||
}
|
}
|
||||||
disp = lv_display_get_next(disp);
|
disp = lv_display_get_next(disp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user