提交 0fc8917b 编写于 作者: P Paul van Brenk

Merge pull request #2661 from paulvanbrenk/master

Null check in AnalyzerHelper for Languages that don't participate in the compilation
......@@ -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.
先完成此消息的编辑!
想要评论请 注册