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
This commit is contained in:
Chris Philips 2023-11-15 13:35:07 -08:00
parent bc45ec257e
commit 3089bb1ebd
No known key found for this signature in database
GPG Key ID: A623DE917D41EFA7

View File

@ -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) {