Merge pull request #264 from soward/development

esp8266gateway crashing when receiving I_CONFIG message from new node…
This commit is contained in:
Henrik Ekblad
2015-11-24 10:59:12 +01:00
+5 -1
View File
@@ -241,7 +241,11 @@ void _processInternalMessages() {
} else if (type == I_CONFIG) {
// Pick up configuration from controller (currently only metric/imperial)
// and store it in eeprom if changed
isMetric = _msg.getString()[0] == 'M' ;
if (_msg.getString() == NULL) {
isMetric = true;
} else {
isMetric = _msg.getString()[0] == 'M' ;
}
_cc.isMetric = isMetric;
hwWriteConfig(EEPROM_CONTROLLER_CONFIG_ADDRESS, isMetric);
} else if (type == I_PRESENTATION) {