Skip to content

Commit

Permalink
#89 fix panic: runtime error: index out of range [1] with length 0 (#90)
Browse files Browse the repository at this point in the history
* #89 fix panic: runtime error: index out of range [1] with length 0
  • Loading branch information
Kayuii authored Mar 8, 2023
1 parent 520b167 commit f1bc636
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 142,11 @@ func parseRouteLine(str string) (*types.Route, bool) {
clean := spaceRemover.ReplaceAllString(str, " ")
clean = tabReplacer.ReplaceAllString(clean, " ")
clean = strings.TrimSpace(clean)

if len(clean) == 0 {
return nil, false
}

result := endingComment.FindStringSubmatch(clean)
tResult := strings.TrimSpace(result[1])
p := strings.Split(tResult, " ")
Expand Down

0 comments on commit f1bc636

Please sign in to comment.