diff --git a/OpenRA.Mods.Common/MapGenerator/MapGeneratorSettings.cs b/OpenRA.Mods.Common/MapGenerator/MapGeneratorSettings.cs index d6e0bea9d7..0fb9db434f 100644 --- a/OpenRA.Mods.Common/MapGenerator/MapGeneratorSettings.cs +++ b/OpenRA.Mods.Common/MapGenerator/MapGeneratorSettings.cs @@ -133,7 +133,7 @@ namespace OpenRA.Mods.Common.MapGenerator get => value; set { - if (!Choices.ContainsKey(value)) + if (value != null && !Choices.ContainsKey(value)) throw new ArgumentException($"{value} is not in the list of valid choices"); this.value = value; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/MapGeneratorToolLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/MapGeneratorToolLogic.cs index 2f693b9beb..8d863035e6 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/MapGeneratorToolLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/MapGeneratorToolLogic.cs @@ -187,7 +187,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (!validChoices.Contains(mo.Value)) mo.Value = mo.Default?.FirstOrDefault(validChoices.Contains) ?? validChoices.FirstOrDefault(); - if (mo.Label != null && validChoices.Count > 0) + if (mo.Value != null && mo.Label != null && validChoices.Count > 0) { settingWidget = dropDownSettingTemplate.Clone(); var labelWidget = settingWidget.Get("LABEL");