Fix error when no valid .NET SDKs were found

This commit is contained in:
2025-04-06 11:47:42 +03:00
parent a9a9057304
commit e6d7024a61

View File

@@ -282,7 +282,7 @@ namespace Flax.Build
var dotnetSdkVersion = GetVersion(dotnetSdkVersions);
var dotnetRuntimeVersion = GetVersion(dotnetRuntimeVersions);
if (!string.IsNullOrEmpty(dotnetRuntimeVersion) && ParseVersion(dotnetRuntimeVersion).Major > ParseVersion(dotnetSdkVersion).Major)
if (!string.IsNullOrEmpty(dotnetSdkVersion) && !string.IsNullOrEmpty(dotnetRuntimeVersion) && ParseVersion(dotnetRuntimeVersion).Major > ParseVersion(dotnetSdkVersion).Major)
{
// Make sure the reference assemblies are not newer than the SDK itself
var dotnetRuntimeVersionsRemaining = dotnetRuntimeVersions;