Fail gracefully when there is just one default difficulty.

This commit is contained in:
Matthias Mailänder
2021-10-10 21:43:49 +02:00
committed by abcdefg30
parent a59f4b2c4a
commit a502e85e68

View File

@@ -109,7 +109,10 @@ namespace OpenRA.Mods.Common.Scripting
.FirstOrDefault(sld => sld.Info.ID == id); .FirstOrDefault(sld => sld.Info.ID == id);
if (option == null) if (option == null)
throw new YamlException("A ScriptLobbyDropdown with ID `" + id + "` was not found."); {
Log.Write("lua", "A ScriptLobbyDropdown with ID `" + id + "` was not found.");
return null;
}
return option.Value; return option.Value;
} }