Throw an ArgumentException when trying to translate null keys

This commit is contained in:
abcdefg30
2023-01-26 10:13:10 +01:00
committed by Pavel Penev
parent 84add8a03d
commit e4bb13ea07

View File

@@ -88,6 +88,9 @@ namespace OpenRA
public bool TryGetString(string key, out string value, IDictionary<string, object> arguments = null)
{
if (string.IsNullOrEmpty(key))
throw new ArgumentException("A translation key must not be null or empty.", nameof(key));
try
{
if (!HasMessage(key))