diff --git a/src/BlitzKit.CLI/Functions/Mangler.cs b/src/BlitzKit.CLI/Functions/Mangler.cs index c2e75908b..b1e7d2f6b 100644 --- a/src/BlitzKit.CLI/Functions/Mangler.cs +++ b/src/BlitzKit.CLI/Functions/Mangler.cs @@ -216,12 +216,28 @@ namespace BlitzKit.CLI.Functions async Task MangleIcon(UObject pda) { var id = PropertyUtil.Get(pda, "TankId").Text; - var smallIcon = BlitzKitExporter.Texture2D(PropertyUtil.Get(pda, "SmallIcon")); - Console.WriteLine(id); - var bigIcon = BlitzKitExporter.Texture2D(PropertyUtil.Get(pda, "BigIcon")); + PropertyUtil.TryGet(pda, "SmallIcon", out var smallIconTexture); + PropertyUtil.TryGet(pda, "BigIcon", out var bigIconTexture); - await assetUploader.Add(new($"tanks/{id}/icons/small.png", smallIcon)); - await assetUploader.Add(new($"tanks/{id}/icons/big.png", bigIcon)); + if (smallIconTexture is null) + { + PrettyLog.Warn($"Small icon missing for {id}"); + } + else + { + var smallIcon = BlitzKitExporter.Texture2D(smallIconTexture); + await assetUploader.Add(new($"tanks/{id}/icons/small.png", smallIcon)); + } + + if (bigIconTexture is null) + { + PrettyLog.Warn($"Big icon missing for {id}"); + } + else + { + var bigIcon = BlitzKitExporter.Texture2D(bigIconTexture); + await assetUploader.Add(new($"tanks/{id}/icons/big.png", bigIcon)); + } } async Task MangleHull(UObject pda)