From c97c88ba8d3a4fed4d9e8d583a82e4bf8a4724b5 Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Tue, 19 Jun 2012 16:50:21 +0200 Subject: [PATCH] Extra check for the value in Nexa device settings. This could lead to a potential crash otherwise --- telldus-gui/TelldusGui/devicesettingnexa.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telldus-gui/TelldusGui/devicesettingnexa.cpp b/telldus-gui/TelldusGui/devicesettingnexa.cpp index dc187a5f..acf24dd0 100644 --- a/telldus-gui/TelldusGui/devicesettingnexa.cpp +++ b/telldus-gui/TelldusGui/devicesettingnexa.cpp @@ -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() );