提交 2b98b284 编写于 作者: P Paul van Brenk

Null check in AnalyzerHelper for Languages that don't participate in the compilation

Added a null check in the AnalyzerHelper for Languages that don't
participate in the compilation. Since TypeScript doesn't participate in
the Compilation we get a null reference exception on the compilation
options.
上级 1f333680
......@@ -124,8 +124,8 @@ private static VersionStamp GetAnalyzerVersion(string path)
bool enabledByDefault)
{
return GetEffectiveSeverity(
options.GeneralDiagnosticOption,
options.SpecificDiagnosticOptions,
options?.GeneralDiagnosticOption ?? ReportDiagnostic.Default,
options?.SpecificDiagnosticOptions,
ruleId,
defaultSeverity,
enabledByDefault);
......@@ -150,7 +150,7 @@ private static VersionStamp GetAnalyzerVersion(string path)
bool enabledByDefault)
{
ReportDiagnostic report = ReportDiagnostic.Default;
var isSpecified = specificOptions.TryGetValue(ruleId, out report);
var isSpecified = specificOptions?.TryGetValue(ruleId, out report) ?? false;
if (!isSpecified)
{
report = enabledByDefault ? ReportDiagnostic.Default : ReportDiagnostic.Suppress;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册