diff --git a/chapi-ast-typescript/src/main/kotlin/chapi/ast/typescriptast/TypeScriptFullIdentListener.kt b/chapi-ast-typescript/src/main/kotlin/chapi/ast/typescriptast/TypeScriptFullIdentListener.kt index fd286efd..f12a2f8e 100644 --- a/chapi-ast-typescript/src/main/kotlin/chapi/ast/typescriptast/TypeScriptFullIdentListener.kt +++ b/chapi-ast-typescript/src/main/kotlin/chapi/ast/typescriptast/TypeScriptFullIdentListener.kt @@ -422,7 +422,10 @@ class TypeScriptFullIdentListener(node: TSIdentify) : TypeScriptAstListener() { // see also in arrow function declaration override fun enterFunctionDeclaration(ctx: TypeScriptParser.FunctionDeclarationContext?) { - val funcName = ctx!!.Identifier().text + if(ctx == null) return + if(ctx.Identifier() == null) return + + val funcName = ctx.Identifier().text val func = CodeFunction(FilePath = filePath) func.Name = funcName