[PATCH weston] shell: Another NULL check.

Kristian Høgsberg hoegsberg at gmail.com
Mon May 14 06:46:26 PDT 2012


On Sun, May 13, 2012 at 12:50:24AM -0600, Scott Moreau wrote:

When does this happen?  If this function is called, there should
always be a shell surface...

Kristian

> ---
>  src/shell.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/src/shell.c b/src/shell.c
> index a44074d..7016bfe 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -2170,9 +2170,14 @@ static void
>  shell_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy)
>  {
>  	struct shell_surface *shsurf = get_shell_surface(es);
> -	struct desktop_shell *shell = shsurf->shell;
> +	struct desktop_shell *shell;
>  	int type_changed = 0;
>  
> +	if (!shsurf)
> +		return;
> +
> +	shell = shsurf->shell;
> +
>  	if (shsurf->next_type != SHELL_SURFACE_NONE &&
>  	    shsurf->type != shsurf->next_type) {
>  		set_surface_type(shsurf);
> -- 
> 1.7.7.6
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list