Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>

On a side note, I don't think Coverity pointed it, so that's a good point for 
cppcheck.
Please note that if wapp->main_window_desc is NULL, there are many other places 
where it may crash apparently.


----- David Maciejak <david.macie...@gmail.com> a écrit :
> moving scr initialization after WApplication existing test
> to prevent crashing in case wapp is null
> 
> ---
>  src/appicon.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/appicon.c b/src/appicon.c
> index f61ae0e..bbf1455 100644
> --- a/src/appicon.c
> +++ b/src/appicon.c
> @@ -197,15 +197,16 @@ void unpaint_app_icon(WApplication *wapp)
>  void paint_app_icon(WApplication *wapp)
>  {
>   WIcon *icon;
> - WScreen *scr = wapp->main_window_desc->screen_ptr;
> + WScreen *scr;
>   WDock *attracting_dock;
>   int x = 0, y = 0;
>   Bool update_icon = False;
> 
> - if (!wapp || !wapp->app_icon)
> + if (!wapp || !wapp->app_icon || !wapp->main_window_desc)
>   return;
> 
>   icon = wapp->app_icon->icon;
> + scr = wapp->main_window_desc->screen_ptr;
>   wapp->app_icon->main_window = wapp->main_window;
> 
>   /* If the icon is docked, don't continue */
> -- 
> 1.8.3.2


--
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to