esp8266gateway crashing when receiving I_CONFIG message from new node due to attempt to dereference the NULL return of MyMessage::getString()

This commit is contained in:
Jps
2015-11-23 17:02:17 -05:00
parent c7814878f2
commit 8ff68f0bbe
+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) {