1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 13:21:23 +01:00

return false if parseS does not find any sensors

This commit is contained in:
Harald Barth 2020-10-27 07:24:48 +01:00
parent 8101e75dae
commit 019001675e

View File

@ -564,6 +564,8 @@ bool DCCEXParser::parseS(Print *stream, int params, int p[])
return true; return true;
case 0: // <S> lit sensor states case 0: // <S> lit sensor states
if (Sensor::firstSensor == NULL)
return false;
for (Sensor *tt = Sensor::firstSensor; tt != NULL; tt = tt->nextSensor) for (Sensor *tt = Sensor::firstSensor; tt != NULL; tt = tt->nextSensor)
{ {
StringFormatter::send(stream, F("<Q %d %d %d>"), tt->data.snum, tt->data.pin, tt->data.pullUp); StringFormatter::send(stream, F("<Q %d %d %d>"), tt->data.snum, tt->data.pin, tt->data.pullUp);