Skip to content
Permalink
Browse files

prevent ArrayIndexOutOfBoundsException when toggling signalmast

  • Loading branch information...
mstevetodd committed Jun 13, 2019
1 parent 2f205bb commit 74a2b6e35a078f62bcfccbdf84befe6fe73abc20
Showing with 10 additions and 7 deletions.
  1. +10 −7 java/src/jmri/implementation/SignalHeadSignalMast.java
@@ -199,15 +199,18 @@ public void setAppearances(String aspect) {

if (!error) {
SignalHead head = heads.get(i).getBean();
int toSet = map.getAspectSettings(aspect)[i];
if (delay == 0) {
head.setAppearance(toSet);
if (log.isDebugEnabled()) {
log.debug("Setting " + head.getSystemName() + " to "
+ head.getAppearanceName(toSet));
int[] dsam = map.getAspectSettings(aspect);
if (i < dsam.length) {
int toSet = dsam[i];
if (delay == 0) {
head.setAppearance(toSet);
log.debug("Setting {} to {}", head.getSystemName(),
head.getAppearanceName(toSet));
} else {
delayedSet.put(head, toSet);
}
} else {
delayedSet.put(head, toSet);
log.error(" head '{}' appearance not set for aspect '{}'", head.getSystemName(), aspect);
}
} else {
log.error(" head appearance not set due to above error");

0 comments on commit 74a2b6e

Please sign in to comment.
You can’t perform that action at this time.