mirror of
https://github.com/dancojocaru2000/CfrTrainInfoTelegramBot.git
synced 2025-02-22 17:19:39 +02:00
Fix OOB bug for trains with multiple groups
This commit is contained in:
parent
24645aea81
commit
af5a3a51de
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue