Skip to content

Commit

Permalink
Fix index out of range (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdigital authored Jan 14, 2024
1 parent 09e6142 commit 0fafc4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/model/torrents.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,14 @@ func (t Torrent) TagNames() []string {
func (t Torrent) fileSearchStrings() []string {
firstPass := make([]string, 0, len(t.Files))
var prevPath string
outer:
for _, f := range t.Files {
i := 0
for {
if i >= len(f.Path) || i >= len(prevPath) || prevPath[i] != f.Path[i] {
if i >= len(f.Path) {
continue outer
}
if i >= len(prevPath) || prevPath[i] != f.Path[i] {
break
}
i++
Expand Down

0 comments on commit 0fafc4e

Please sign in to comment.