diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index d136f460..c502c742 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -81,10 +81,16 @@ ivi_shell_surface_configure(struct weston_surface *, int32_t, int32_t); static struct ivi_shell_surface * get_ivi_shell_surface(struct weston_surface *surface) { - if (surface->configure == ivi_shell_surface_configure) - return surface->configure_private; + struct ivi_shell_surface *shsurf; + + if (surface->configure != ivi_shell_surface_configure) + return NULL; + + shsurf = surface->configure_private; + assert(shsurf); + assert(shsurf->surface == surface); - return NULL; + return shsurf; } void