From: Seunghun Lee Date: Fri, 2 Jun 2023 04:33:46 +0000 (+0900) Subject: surface: Add null check on role_data X-Git-Tag: accepted/tizen/unified/20230720.164642~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=800751f4b02a010c0275a56246bb5033e722e069;p=platform%2Fcore%2Fuifw%2Flibds.git surface: Add null check on role_data The role_data can be null if the role is no longer valid. Change-Id: If7da1906ea9c8aa1bffc440417ea7881c22e57ab --- diff --git a/src/shell_surface.c b/src/shell_surface.c index 9d7fab1..e6dc75b 100644 --- a/src/shell_surface.c +++ b/src/shell_surface.c @@ -224,6 +224,9 @@ handle_shell_surface_commit(struct ds_surface *surface) struct ds_shell_surface *shell_surface; shell_surface = ds_surface_get_role_data(surface); + if (!shell_surface) + return; + shell_surface->current = shell_surface->pending; switch (shell_surface->role) { diff --git a/src/xdg_shell/xdg_surface.c b/src/xdg_shell/xdg_surface.c index 4a797a0..8e2f0a8 100644 --- a/src/xdg_shell/xdg_surface.c +++ b/src/xdg_shell/xdg_surface.c @@ -201,6 +201,9 @@ handle_xdg_surface_commit(struct ds_surface *ds_surface) struct ds_xdg_surface *surface; surface = ds_surface_get_role_data(ds_surface); + if (!surface) + return; + surface->current = surface->pending; switch (surface->role) { diff --git a/src/xdg_shell_v6/xdg_surface_v6.c b/src/xdg_shell_v6/xdg_surface_v6.c index 8483c59..8e383a0 100644 --- a/src/xdg_shell_v6/xdg_surface_v6.c +++ b/src/xdg_shell_v6/xdg_surface_v6.c @@ -198,6 +198,9 @@ handle_xdg_surface_v6_commit(struct ds_surface *ds_surface) struct ds_xdg_surface_v6 *surface; surface = ds_surface_get_role_data(ds_surface); + if (!surface) + return; + surface->current = surface->pending; switch (surface->role) {