Skip to content

Commit 8e2c8cb

Browse files
committed
Merge pull request arduino#264 from soward/development
esp8266gateway crashing when receiving I_CONFIG message from new node…
2 parents c781487 + 8ff68f0 commit 8e2c8cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libraries/MySensors/core/MySensorCore.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ void _processInternalMessages() {
241241
} else if (type == I_CONFIG) {
242242
// Pick up configuration from controller (currently only metric/imperial)
243243
// and store it in eeprom if changed
244-
isMetric = _msg.getString()[0] == 'M' ;
244+
if (_msg.getString() == NULL) {
245+
isMetric = true;
246+
} else {
247+
isMetric = _msg.getString()[0] == 'M' ;
248+
}
245249
_cc.isMetric = isMetric;
246250
hwWriteConfig(EEPROM_CONTROLLER_CONFIG_ADDRESS, isMetric);
247251
} else if (type == I_PRESENTATION) {

0 commit comments

Comments
 (0)