diff --git a/cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java b/cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java index 9ed7404c..a84bcb5a 100644 --- a/cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java +++ b/cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java @@ -344,6 +344,9 @@ private List extractListeners(ServiceDeclarationNode serviceDeclar } listenerInfo = httpsListener.get(); } else { + if (expressionNode.kind() != SyntaxKind.EXPLICIT_NEW_EXPRESSION) { + return Collections.emptyList(); + } //Inline Listener ExplicitNewExpressionNode refNode = (ExplicitNewExpressionNode) expressionNode; FunctionArgumentNode functionArgumentNode = refNode.parenthesizedArgList().arguments().get(0);