From 0376f925427709a1ef1e9be94e67a966587b781e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20St=C3=BChmer?= Date: Thu, 21 Nov 2024 01:05:37 +0100 Subject: [PATCH] fix: correct condition for `isValidValue` (#21) --- .../Diagnostics/IsPackableProjectDiagnosticAnalyzer.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/NetEvolve.Defaults.Analyzer/Diagnostics/IsPackableProjectDiagnosticAnalyzer.cs b/src/NetEvolve.Defaults.Analyzer/Diagnostics/IsPackableProjectDiagnosticAnalyzer.cs index 378188b..76e8d4e 100644 --- a/src/NetEvolve.Defaults.Analyzer/Diagnostics/IsPackableProjectDiagnosticAnalyzer.cs +++ b/src/NetEvolve.Defaults.Analyzer/Diagnostics/IsPackableProjectDiagnosticAnalyzer.cs @@ -1,4 +1,4 @@ -namespace NetEvolve.Defaults.Analyzer.Diagnostics; +namespace NetEvolve.Defaults.Analyzer.Diagnostics; using System; using System.Collections.Immutable; @@ -130,8 +130,7 @@ private static bool ValidateKey( return !isConfigured || string.IsNullOrWhiteSpace(configuredValue) - || isValidValue is null - || !isValidValue.Invoke(configuredValue!); + || (isValidValue is not null && !isValidValue.Invoke(configuredValue!)); } private static bool IsPackable(AnalyzerConfigOptions options) =>