From 8eed105fc3f6086f17fabcef8ef6f4b08ebac0a6 Mon Sep 17 00:00:00 2001 From: rdulmina Date: Mon, 6 Jan 2025 12:44:51 +0530 Subject: [PATCH] Add null check before accessing `type.tsymbol` --- .../compiler/semantics/analyzer/CodeAnalyzer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/CodeAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/CodeAnalyzer.java index a3920e3d2720..5f72c9672acf 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/CodeAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/CodeAnalyzer.java @@ -2804,7 +2804,8 @@ public void visit(BLangTypeInit cIExpr, AnalyzerData data) { analyzeExprs(cIExpr.argsExpr, data); analyzeExpr(cIExpr.initInvocation, data); BType type = cIExpr.getBType(); - if (cIExpr.userDefinedType != null && Symbols.isFlagOn(type.tsymbol.flags, Flags.DEPRECATED)) { + if (cIExpr.userDefinedType != null && type.tsymbol != null && + Symbols.isFlagOn(type.tsymbol.flags, Flags.DEPRECATED)) { logDeprecatedWaring(((BLangUserDefinedType) cIExpr.userDefinedType).typeName.toString(), type.tsymbol, cIExpr.pos); }