From 3089bb1ebdea5c87c2358d4aab8cc7da657e74ad Mon Sep 17 00:00:00 2001 From: Chris Philips Date: Wed, 15 Nov 2023 13:35:07 -0800 Subject: [PATCH] fix: allow null version the only way this is valid is if rollForward is `latestMajor`, which is the only value that the global.json spec says doesn't require a version to be specified --- src/setup-dotnet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/setup-dotnet.ts b/src/setup-dotnet.ts index 092bf59..0e8edb6 100644 --- a/src/setup-dotnet.ts +++ b/src/setup-dotnet.ts @@ -111,7 +111,7 @@ function getVersionFromGlobalJson(globalJsonPath: string): string { version = globalJson.sdk.version; const rollForward = globalJson.sdk.rollForward; if (rollForward && rollForward.startsWith('latest')) { - const [major, minor, featurePatch] = version.split('.'); + const [major, minor, featurePatch] = (version || '').split('.'); const feature = featurePatch.substring(0, 1); switch (rollForward) {