diff --git a/src/D2L.CodeStyle.Analyzers/D2L.CodeStyle.Analyzers.csproj b/src/D2L.CodeStyle.Analyzers/D2L.CodeStyle.Analyzers.csproj
index a2962efb..471366c3 100644
--- a/src/D2L.CodeStyle.Analyzers/D2L.CodeStyle.Analyzers.csproj
+++ b/src/D2L.CodeStyle.Analyzers/D2L.CodeStyle.Analyzers.csproj
@@ -6,7 +6,7 @@
D2L.CodeStyle.Analyzers
D2L.CodeStyle
D2L.CodeStyle analyzers
- 0.230.0
+ 0.231.0
Apache-2.0
https://github.com/Brightspace/D2L.CodeStyle
D2L
diff --git a/src/D2L.CodeStyle.TestAnalyzers/D2L.CodeStyle.TestAnalyzers.csproj b/src/D2L.CodeStyle.TestAnalyzers/D2L.CodeStyle.TestAnalyzers.csproj
index f94b35e1..94d9d9c4 100644
--- a/src/D2L.CodeStyle.TestAnalyzers/D2L.CodeStyle.TestAnalyzers.csproj
+++ b/src/D2L.CodeStyle.TestAnalyzers/D2L.CodeStyle.TestAnalyzers.csproj
@@ -6,7 +6,7 @@
D2L.CodeStyle.TestAnalyzers
D2L.CodeStyle
D2L.CodeStyle test analyzers
- 0.33.0
+ 0.34.0
Apache-2.0
https://github.com/Brightspace/D2L.CodeStyle
D2L
diff --git a/src/Rules/D2L.CodeStyle.Analyzers.Rule.Constant/D2L.CodeStyle.Analyzers.Rule.Constant/ConstantAttributeAnalyzer.cs b/src/Rules/D2L.CodeStyle.Analyzers.Rule.Constant/D2L.CodeStyle.Analyzers.Rule.Constant/ConstantAttributeAnalyzer.cs
index b5b4a97a..3f3db4c5 100644
--- a/src/Rules/D2L.CodeStyle.Analyzers.Rule.Constant/D2L.CodeStyle.Analyzers.Rule.Constant/ConstantAttributeAnalyzer.cs
+++ b/src/Rules/D2L.CodeStyle.Analyzers.Rule.Constant/D2L.CodeStyle.Analyzers.Rule.Constant/ConstantAttributeAnalyzer.cs
@@ -190,6 +190,10 @@ private static void AnalyzeConversion(
ITypeSymbol targetType,
SyntaxNode diagnosticSyntax
) {
+ if( sourceType is null ) {
+ return;
+ }
+
Conversion conversion = context.Compilation.ClassifyConversion(
source: sourceType,
destination: targetType
diff --git a/tests/D2L.CodeStyle.Analyzers.Test/Specs/ConstantAttributeAnalyzer.cs b/tests/D2L.CodeStyle.Analyzers.Test/Specs/ConstantAttributeAnalyzer.cs
index 72b31270..c5dfa637 100644
--- a/tests/D2L.CodeStyle.Analyzers.Test/Specs/ConstantAttributeAnalyzer.cs
+++ b/tests/D2L.CodeStyle.Analyzers.Test/Specs/ConstantAttributeAnalyzer.cs
@@ -275,6 +275,7 @@ string untrusted
{ Types.ConstantStruct v = trusted; }
{ Types.ConstantStruct v = /* NonConstantPassedToConstantParameter(value) */ variable /**/; }
{ Types.ConstantStruct v = /* NonConstantPassedToConstantParameter(value) */ untrusted /**/; }
+ { Types.ConstantStruct v = /* NonConstantPassedToConstantParameter(value) */ trusted ?? throw new ArgumentNullException( nameof( trusted ) ) /**/; }
{ (Types.ConstantStruct X, Types.ConstantStruct Y) v = (Constants.String, Constants.String); }
{ (Types.ConstantStruct X, Types.ConstantStruct Y) v = (Constants.String, trusted); }
{ (Types.ConstantStruct X, Types.ConstantStruct Y) v = (Constants.String, /* NonConstantPassedToConstantParameter(value) */ variable /**/); }