diff --git a/pkg/handlers/findTrain.go b/pkg/handlers/findTrain.go index 9ee5688..71f7dae 100644 --- a/pkg/handlers/findTrain.go +++ b/pkg/handlers/findTrain.go @@ -75,6 +75,9 @@ func HandleTrainNumberCommand(ctx context.Context, trainNumber string, date time } shouldUnsubscribe := func() bool { + if groupIndex == -1 { + return false + } if len(trainData.Groups) <= groupIndex { groupIndex = 0 }