File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -790,12 +790,16 @@ func getModuleLiteralImportKind(node *ast.StringLiteralLike) *string {
790790 }
791791
792792 if ast .IsImportDeclaration (parent ) || ast .IsExportDeclaration (parent ) {
793- var elements [] * ast.Node
793+ var attrs * ast.ImportAttributesNode
794794 if ast .IsImportDeclaration (parent ) {
795- elements = parent .AsImportDeclaration ().Attributes . AsImportAttributes (). Attributes . Nodes
795+ attrs = parent .AsImportDeclaration ().Attributes
796796 } else {
797- elements = parent .AsExportDeclaration ().Attributes . AsImportAttributes (). Attributes . Nodes
797+ attrs = parent .AsExportDeclaration ().Attributes
798798 }
799+ if attrs == nil {
800+ return nil
801+ }
802+ elements := attrs .AsImportAttributes ().Attributes .Nodes
799803 if elements == nil {
800804 return nil
801805 }
You can’t perform that action at this time.
0 commit comments