From 337eb7a7ee95903fdbc8018fcccfa330a71a202a Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Tue, 12 Nov 2024 22:01:23 +1100 Subject: [PATCH] leverage out null pattern in IsValidDeploymentItem --- .../Utilities/DeploymentItemUtility.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs b/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs index a787c71b3e..33edaffa5b 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs @@ -79,7 +79,7 @@ internal IList GetClassLevelDeploymentItems(Type type, ICollecti /// The warning message if it is an invalid deployment item. /// Returns true if it is a valid deployment item. [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#", Justification = "Internal method.")] - internal static bool IsValidDeploymentItem([NotNullWhen(true)] string? sourcePath, [NotNullWhen(true)] string? relativeOutputDirectory, out string warning) + internal static bool IsValidDeploymentItem([NotNullWhen(true)] string? sourcePath, [NotNullWhen(true)] string? relativeOutputDirectory, [NotNullWhen(false)] out string? warning) { if (StringEx.IsNullOrEmpty(sourcePath)) { @@ -105,7 +105,7 @@ internal static bool IsValidDeploymentItem([NotNullWhen(true)] string? sourcePat return false; } - warning = string.Empty; + warning = null; return true; }