From b0357529a4d98708da07e4a7ba91ca78c89cba42 Mon Sep 17 00:00:00 2001 From: BlueRain-debug <68976789+BlueRain-debug@users.noreply.github.com> Date: Tue, 25 Nov 2025 09:22:12 +0800 Subject: [PATCH] Update BuildMetadataHandler.cs: Corrected the logic for some package events where IsRemoval=true. Corrected the logic for some package events where IsRemoval=true. In this case, PackageFile might be empty (this happened on my old 20279 installation). --- src/MobilePackageGen.Common/BuildMetadataHandler.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/MobilePackageGen.Common/BuildMetadataHandler.cs b/src/MobilePackageGen.Common/BuildMetadataHandler.cs index 4843417..d5ba08f 100644 --- a/src/MobilePackageGen.Common/BuildMetadataHandler.cs +++ b/src/MobilePackageGen.Common/BuildMetadataHandler.cs @@ -408,12 +408,12 @@ public static (string cabFileName, string cabFile) GetPackageNamingForCBS(XmlMum { foreach (UpdateHistory.Package Package in UpdateEvent.UpdateOSOutput.Packages.Package) { - if (Package.PackageFile.EndsWith(".mum", StringComparison.InvariantCultureIgnoreCase)) + if (Package.PackageIdentity == null || Package.PackageFile == null) { continue; } - - if (Package.PackageIdentity == null) + + if (Package.PackageFile.EndsWith(".mum", StringComparison.InvariantCultureIgnoreCase)) { continue; } @@ -468,6 +468,11 @@ public static (string cabFileName, string cabFile) GetPackageNamingForINF(string { foreach (UpdateHistory.Package Package in UpdateEvent.UpdateOSOutput.Packages.Package) { + if (Package.PackageFile == null) + { + continue; + } + if (Package.PackageFile.EndsWith(".mum", StringComparison.InvariantCultureIgnoreCase)) { continue;