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

Do not crash on turnouts or turntables without description

This commit is contained in:
Harald Barth 2024-01-10 08:15:30 +01:00
parent c336ab0bb4
commit ca380d11dc

View File

@ -334,12 +334,14 @@ if (compileFeatures & FEATURE_SIGNAL) {
void RMFT2::setTurnoutHiddenState(Turnout * t) { void RMFT2::setTurnoutHiddenState(Turnout * t) {
// turnout descriptions are in low flash F strings // turnout descriptions are in low flash F strings
t->setHidden(GETFLASH(getTurnoutDescription(t->getId()))==0x01); const FSH *desc = getTurnoutDescription(t->getId());
if (desc) t->setHidden(GETFLASH(desc)==0x01);
} }
#ifndef IO_NO_HAL #ifndef IO_NO_HAL
void RMFT2::setTurntableHiddenState(Turntable * tto) { void RMFT2::setTurntableHiddenState(Turntable * tto) {
tto->setHidden(GETFLASH(getTurntableDescription(tto->getId()))==0x01); const FSH *desc = getTurntableDescription(tto->getId());
if (desc) tto->setHidden(GETFLASH(desc)==0x01);
} }
#endif #endif