Extra check for the value in Nexa device settings. This could lead to a potential crash otherwise

This commit is contained in:
Micke Prag 2012-06-19 16:50:21 +02:00
parent 39c6bb012e
commit c97c88ba8d

View file

@ -88,7 +88,10 @@ void DeviceSettingNexa::saveParameters() {
void DeviceSettingNexa::setValue( const QString &name, const QString &value ) {
if (name == "house") {
uint intHouse = value[0].toUpper().toAscii() - 'A';
uint intHouse = 0;
if (value.length() > 0) {
intHouse = value[0].toUpper().toAscii() - 'A';
}
dialHouse->setValue( intHouse );
} else if (name == "unit") {
dialUnit->setValue( value.toInt() );