Skip to content

Commit

Permalink
Do not crash on turnouts without description
Browse files Browse the repository at this point in the history
  • Loading branch information
habazut committed Jan 10, 2024
1 parent 387ea01 commit c5168f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions EXRAIL2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,9 @@ LookList* RMFT2::LookListLoader(OPCODE op1, OPCODE op2, OPCODE op3) {
}

void RMFT2::setTurnoutHiddenState(Turnout * t) {
// turnout descriptions are in low flash F strings
t->setHidden(GETFLASH(getTurnoutDescription(t->getId()))==0x01);
// turnout descriptions are in low flash F strings
const FSH *desc = getTurnoutDescription(t->getId());
if (desc) t->setHidden(GETFLASH(desc)==0x01);
}

char RMFT2::getRouteType(int16_t id) {
Expand Down

0 comments on commit c5168f0

Please sign in to comment.