Skip to content

Commit 4a366a5

Browse files
committed
fix: guard against empty Version in configured-but-not-loaded package passthrough
PopulatePackages' "configured but not currently loaded" pass-through could still emit PackageVersion entries with a null/empty Version, reintroducing the schema issue the loaded-reflection branch's own guard already prevents (downstream parsers drop entries whose version isn't a string).
1 parent 4631d3a commit 4a366a5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/PepperDash.Essentials.Core/Web/RequestHandlers/GetPackageManifestRequestHandler.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,11 @@ private static void PopulatePackages(VersionData result)
186186
}
187187
}
188188

189-
// Configured but not currently loaded - pass through unchanged
190-
mergedPackages.AddRange(configPackages.Where(p => !matchedConfigPackages.Contains(p)));
189+
// Configured but not currently loaded - pass through unchanged, but keep the same
190+
// "never emit an entry with no version" guarantee as the loaded-reflection branch above -
191+
// otherwise this branch reintroduces the schema issue that guard is meant to prevent.
192+
mergedPackages.AddRange(configPackages.Where(p =>
193+
!matchedConfigPackages.Contains(p) && !string.IsNullOrEmpty(p.Version)));
191194

192195
result.Packages = mergedPackages;
193196
}

0 commit comments

Comments
 (0)