From 4a2cc09786d97e3177aa237d0fdca4b5483e5633 Mon Sep 17 00:00:00 2001 From: soul Date: Sat, 28 Nov 2026 00:19:49 +0100 Subject: [PATCH] ship-authoring product: a hull stored with no roles takes a product with none Zenith decodes with a null Roles list, so a station made --like it failed product with a null source. The kind and product tests cover it. Co-Authored-By: Claude Sonnet 5.5 --- tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs | 5 +++++ tools/AetherDb/ShipAuthoringCommands.cs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs index c74d23dc0..0ab632e09 100644 --- a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs @@ -701,6 +701,11 @@ public sealed class ShipModCatalogTests : IDisposable Assert.Equal(0, code); Assert.Equal("", error); Assert.Equal("station-kind:depot", ShipAuthoringStore.Load(target).Hull.Kind.Key.Value); + + // A station made like Zenith carries no roles; its product still takes none. + (code, _, error) = Run("product", target, "Zhestokost", "--name", "Probe Depot"); + Assert.Equal((0, ""), (code, error)); + Assert.Empty(ShipAuthoringStore.Load(target).Products.Single().Roles); } // validate judges a finished station package's kind with the rule Compose applies, before compose does. diff --git a/tools/AetherDb/ShipAuthoringCommands.cs b/tools/AetherDb/ShipAuthoringCommands.cs index 426707e2d..1b9de869b 100644 --- a/tools/AetherDb/ShipAuthoringCommands.cs +++ b/tools/AetherDb/ShipAuthoringCommands.cs @@ -197,7 +197,8 @@ public static class ShipAuthoringCommands Description = count == 7 ? args[6] : null, Design = new CultRecordRef(ShipModCatalog.HullKey(ship.Id)), Manufacturer = new CultRecordRef(makerKey), - Roles = hull.Roles.Select(role => new ProductRole { Role = role.Name }).ToList(), + // A hull stored with no roles (Zenith, so a station made --like it) decodes with a null list. + Roles = (hull.Roles ?? new List()).Select(role => new ProductRole { Role = role.Name }).ToList(), NotOffered = notOffered }); cache.FlushAsync().Wait();