From 1541fc31ead99a358c649e7e9fa203e0dd4d20a5 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Fri, 14 Apr 2023 11:52:46 -0500 Subject: [PATCH] Check for null Path (#4391) --- .../Hosting/DotnetTestHostManager.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs index 2957410eac..02dad4370a 100644 --- a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs +++ b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs @@ -777,7 +777,10 @@ private string GetTestHostPath(string runtimeConfigDevPath, string depsFilePath, } } - testHostPath = Path.Combine(testhostPackage.Path, testHostPath); + if (testhostPackage.Path is not null) + { + testHostPath = Path.Combine(testhostPackage.Path, testHostPath); + } _hostPackageVersion = testhostPackage.Version; IsVersionCheckRequired = !_hostPackageVersion.StartsWith("15.0.0"); EqtTrace.Verbose("DotnetTestHostmanager: Relative path of testhost.dll with respect to package folder is {0}", testHostPath);