Don't crash when SwitchPanelImages is None.
commit3966cd2fc200bfccd12fefd1d999e6f700fd17be
authorIain Patterson <wm@iain.cx>
Wed, 19 Jun 2013 16:35:09 +0000 (19 17:35 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Wed, 19 Jun 2013 17:02:15 +0000 (19 18:02 +0100)
tree9e5419c5aa2e6a5c85025929185dbd0b1da361b2
parent527f5f1730cf023e33a67b16721f92dc8bb4822a
Don't crash when SwitchPanelImages is None.

The whole changeImage() function in switchpanel.c is a no-op if
wPreferences.swtileImage is set to None because the panel isn't actually
drawn in that case.  As a consequence there are no images to change.

As well as being logically incorrect the existing code causes a segfault
if the user has the SwitchPanelImages preference set to None because
changeImage() would attempt to access the icons and images arrays which
are only initialised in wInitSwitchPanel() when swtileImage has a value.

Bug report and diagnosis by Juan Giordana, Gabriel Vlasiu and Christophe
Curis.
src/switchpanel.c