Skip to content

Commit

Permalink
Add null check before accessing type.tsymbol
Browse files Browse the repository at this point in the history
  • Loading branch information
rdulmina committed Jan 6, 2025
1 parent 8ef9be1 commit 8eed105
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8eed105

Please sign in to comment.