diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index b1eb631..9432a4f 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -436,7 +436,7 @@ bool DCCEXParser::parseZ(Print *stream, int params, int p[]) case 3: // if (!Output::create(p[0], p[1], p[2], 1)) - return false; + return false; StringFormatter::send(stream, F("")); return true; @@ -554,7 +554,7 @@ bool DCCEXParser::parseS(Print *stream, int params, int p[]) case 3: // create sensor. pullUp indicator (0=LOW/1=HIGH) if (!Sensor::create(p[0], p[1], p[2])) return false; - StringFormatter::send(stream, F("")); + StringFormatter::send(stream, F("")); return true; case 1: // S id> remove sensor @@ -564,6 +564,8 @@ bool DCCEXParser::parseS(Print *stream, int params, int p[]) return true; case 0: // lit sensor states + if (Sensor::firstSensor == NULL) + return false; for (Sensor *tt = Sensor::firstSensor; tt != NULL; tt = tt->nextSensor) { StringFormatter::send(stream, F(""), tt->data.snum, tt->data.pin, tt->data.pullUp);