Skip to content

Commit 552c79a

Browse files
fix: Fix bug
1 parent 472d06b commit 552c79a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

parser/parseutil/extract.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,12 @@ func parseInsertColumns(reader *astutil.NodeReader) []ast.Node {
175175
if ok {
176176
return []ast.Node{inner}
177177
}
178-
firstToken, ok := parenthesis.Inner().GetTokens()[0].(*ast.IdentiferList)
179-
if ok {
180-
return []ast.Node{firstToken}
178+
list := parenthesis.Inner().GetTokens()
179+
if len(list) > 0 {
180+
firstToken, ok := list[0].(*ast.IdentiferList)
181+
if ok {
182+
return []ast.Node{firstToken}
183+
}
181184
}
182185
return []ast.Node{}
183186
}

0 commit comments

Comments
 (0)