Browse Source

Fix OOB bug for trains with multiple groups

master
Kenneth Bruen 11 months ago
parent
commit
af5a3a51de
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 3
      pkg/handlers/findTrain.go

3
pkg/handlers/findTrain.go

@ -75,6 +75,9 @@ func HandleTrainNumberCommand(ctx context.Context, trainNumber string, date time
} }
shouldUnsubscribe := func() bool { shouldUnsubscribe := func() bool {
if groupIndex == -1 {
return false
}
if len(trainData.Groups) <= groupIndex { if len(trainData.Groups) <= groupIndex {
groupIndex = 0 groupIndex = 0
} }

Loading…
Cancel
Save