Avoid crash on icon move without command
commitbf2f9421388a56f804b7912de137fb12d062f106
authorRodolfo García Peñas (kix) <kix@kix.es>
Thu, 22 Nov 2012 21:40:12 +0000 (22 22:40 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Tue, 27 Nov 2012 23:12:59 +0000 (28 00:12 +0100)
treed5e95008bb5c1646e299cc752aa24745f25dcb7d
parent914d4e06effcc78df4ffcf92175d51e4af45ff75
Avoid crash on icon move without command

This patch avoid a crash when moving an icon without command.
To reproduce the problem:

1. Launch an application, for example xeyes, with appicon.
2. Move the appicon to the clip.
3. Close the application.
4. Edit the appicon in the clip, and empty the commands fields.
5. Move the appicon from the clip to the dock. -> Crash.

The crash happends because icon->icon->owner is NULL and then
wwin will be NULL. Then the call of wwin->client_win will crash.

This patch checks if icon->icon->owner is not null (application is
running) and then assign it to wwin. Then get the command from the
running application.
src/dock.c