We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 186cfd5 commit 4abccdbCopy full SHA for 4abccdb
1 file changed
CodeConverter/VB/CommonConversions.cs
@@ -147,8 +147,9 @@ private VariableDeclaratorSyntax ConvertToVariableDeclarator(CSS.DeclarationExpr
147
var ids = SyntaxFactory.SingletonSeparatedList(SyntaxFactory.ModifiedIdentifier(id));
148
TypeSyntax typeSyntax;
149
if (des.Type.IsVar) {
150
- var typeSymbol = ModelExtensions.GetSymbolInfo(_semanticModel, des.Type).ExtractBestMatch<ITypeSymbol>();
151
- typeSyntax =(TypeSyntax) VbSyntaxGenerator.TypeExpression(typeSymbol);
+ typeSyntax = ModelExtensions.GetSymbolInfo(_semanticModel, des.Type).ExtractBestMatch<ITypeSymbol>() is { } typeSymbol
+ ? (TypeSyntax) VbSyntaxGenerator.TypeExpression(typeSymbol)
152
+ : null;
153
} else {
154
typeSyntax = (TypeSyntax)des.Type.Accept(_nodesVisitor);
155
}
0 commit comments