From 552c79a61d2fda065256f785b20487a87f630389 Mon Sep 17 00:00:00 2001 From: lighttiger2505 Date: Wed, 10 Mar 2021 22:55:37 +0900 Subject: [PATCH] fix: Fix bug --- parser/parseutil/extract.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/parser/parseutil/extract.go b/parser/parseutil/extract.go index 274e71d..4db8c80 100644 --- a/parser/parseutil/extract.go +++ b/parser/parseutil/extract.go @@ -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{} }