diff --git a/.yarn/versions/7bfd08a0.yml b/.yarn/versions/7bfd08a0.yml new file mode 100644 index 000000000000..a10256495695 --- /dev/null +++ b/.yarn/versions/7bfd08a0.yml @@ -0,0 +1,2 @@ +releases: + "@yarnpkg/plugin-version": prerelease diff --git a/packages/plugin-version/sources/versionUtils.ts b/packages/plugin-version/sources/versionUtils.ts index 9901ac781c93..b2d377d28816 100644 --- a/packages/plugin-version/sources/versionUtils.ts +++ b/packages/plugin-version/sources/versionUtils.ts @@ -174,10 +174,11 @@ export async function updateVersionFiles(project: Project) { const versionContent = await xfs.readFilePromise(versionPath, `utf8`); const versionData = parseSyml(versionContent); - if (typeof versionData.releases === `undefined`) + const releases = versionData?.releases; + if (!releases) continue; - for (const locatorStr of Object.keys(versionData.releases || {})) { + for (const locatorStr of Object.keys(releases)) { const locator = structUtils.parseLocator(locatorStr); const workspace = project.tryWorkspaceByLocator(locator);