Skip to content

Commit

Permalink
fix: Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lighttiger2505 committed Mar 10, 2021
1 parent 472d06b commit 552c79a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions parser/parseutil/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,12 @@ func parseInsertColumns(reader *astutil.NodeReader) []ast.Node {
if ok {
return []ast.Node{inner}
}
firstToken, ok := parenthesis.Inner().GetTokens()[0].(*ast.IdentiferList)
if ok {
return []ast.Node{firstToken}
list := parenthesis.Inner().GetTokens()
if len(list) > 0 {
firstToken, ok := list[0].(*ast.IdentiferList)
if ok {
return []ast.Node{firstToken}
}
}
return []ast.Node{}
}
Expand Down

0 comments on commit 552c79a

Please sign in to comment.