Skip to content

Commit 186e40b

Browse files
Update BuildMetadataHandler.cs: Corrected the logic for some package events where IsRemoval=true. (#12)
Corrected the logic for some package events where IsRemoval=true. In this case, PackageFile might be empty (this happened on my old 20279 installation).
1 parent 5b21f05 commit 186e40b

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/MobilePackageGen.Common/BuildMetadataHandler.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,12 @@ public static (string cabFileName, string cabFile) GetPackageNamingForCBS(XmlMum
408408
{
409409
foreach (UpdateHistory.Package Package in UpdateEvent.UpdateOSOutput.Packages.Package)
410410
{
411-
if (Package.PackageFile.EndsWith(".mum", StringComparison.InvariantCultureIgnoreCase))
411+
if (Package.PackageIdentity == null || Package.PackageFile == null)
412412
{
413413
continue;
414414
}
415-
416-
if (Package.PackageIdentity == null)
415+
416+
if (Package.PackageFile.EndsWith(".mum", StringComparison.InvariantCultureIgnoreCase))
417417
{
418418
continue;
419419
}
@@ -468,6 +468,11 @@ public static (string cabFileName, string cabFile) GetPackageNamingForINF(string
468468
{
469469
foreach (UpdateHistory.Package Package in UpdateEvent.UpdateOSOutput.Packages.Package)
470470
{
471+
if (Package.PackageFile == null)
472+
{
473+
continue;
474+
}
475+
471476
if (Package.PackageFile.EndsWith(".mum", StringComparison.InvariantCultureIgnoreCase))
472477
{
473478
continue;

0 commit comments

Comments
 (0)