changeset 33056:1c2070f0abca

Prevent a segmentation fault. If hpotmeter couldn't be created, a further item processing must not take place.
author ib
date Tue, 29 Mar 2011 10:45:13 +0000
parents 2be86f1db767
children 0d6b33bc311e
files gui/skin/skin.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/skin.c	Tue Mar 29 10:31:03 2011 +0000
+++ b/gui/skin/skin.c	Tue Mar 29 10:45:13 2011 +0000
@@ -560,11 +560,15 @@
 // vpotmeter=button,bwidth,bheight,phases,numphases,default,x,y,width,height,message
 static int cmd_vpotmeter(char *in)
 {
-    int r = cmd_hpotmeter(in);
+    int r;
     wItem *item;
 
+    r = cmd_hpotmeter(in);
+
+    if (r == 0) {
     item       = &currWinItems[*currWinItemIdx];
     item->type = itVPotmeter;
+    }
 
     return r;
 }