Skip to content

Commit

Permalink
Fix: Make sure loc[1] exists
Browse files Browse the repository at this point in the history
  • Loading branch information
QuangTung97 committed May 7, 2021
1 parent 3ab43db commit f107302
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion named.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func findMatchingClosingBracketIndex(s string) int {
func fixBound(bound string, loop int) string {
loc := valuesReg.FindStringIndex(bound)
// defensive guard when "VALUES (...)" not found
if len(loc) < 1 {
if len(loc) < 2 {
return bound
}

Expand Down

0 comments on commit f107302

Please sign in to comment.