The role_data can be null if the role is no longer valid.
Change-Id: If7da1906ea9c8aa1bffc440417ea7881c22e57ab
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) {
struct ds_xdg_surface *surface;
surface = ds_surface_get_role_data(ds_surface);
+ if (!surface)
+ return;
+
surface->current = surface->pending;
switch (surface->role) {
struct ds_xdg_surface_v6 *surface;
surface = ds_surface_get_role_data(ds_surface);
+ if (!surface)
+ return;
+
surface->current = surface->pending;
switch (surface->role) {