Extra check for the value in Nexa device settings. This could lead to a potential crash otherwise
This commit is contained in:
parent
39c6bb012e
commit
c97c88ba8d
1 changed files with 4 additions and 1 deletions
|
@ -88,7 +88,10 @@ void DeviceSettingNexa::saveParameters() {
|
||||||
|
|
||||||
void DeviceSettingNexa::setValue( const QString &name, const QString &value ) {
|
void DeviceSettingNexa::setValue( const QString &name, const QString &value ) {
|
||||||
if (name == "house") {
|
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 );
|
dialHouse->setValue( intHouse );
|
||||||
} else if (name == "unit") {
|
} else if (name == "unit") {
|
||||||
dialUnit->setValue( value.toInt() );
|
dialUnit->setValue( value.toInt() );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue