1
0
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:
Toni Neubert 2024-09-05 04:51:59 +02:00 committed by GitHub
parent caa09a1564
commit 91d64b1042
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -166,7 +166,7 @@ lv_display_t * lv_sdl_get_disp_from_win_id(uint32_t win_id)
while(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;
}
disp = lv_display_get_next(disp);