diff --git a/OpenRA.Game/Widgets/WidgetLoader.cs b/OpenRA.Game/Widgets/WidgetLoader.cs index 662148918e..d01bd82318 100644 --- a/OpenRA.Game/Widgets/WidgetLoader.cs +++ b/OpenRA.Game/Widgets/WidgetLoader.cs @@ -24,7 +24,12 @@ namespace OpenRA { foreach( var file in modData.Manifest.ChromeLayout.Select( a => MiniYaml.FromFile( a ) ) ) foreach( var w in file ) - widgets.Add( w.Key.Substring( w.Key.IndexOf( '@' ) + 1 ), w ); + { + var key = w.Key.Substring( w.Key.IndexOf( '@' ) + 1 ); + if (widgets.ContainsKey(key)) + throw new InvalidDataException("Widget has duplicate Key `{0}`".F(w.Key)); + widgets.Add( key, w ); + } } public Widget LoadWidget( Dictionary args, Widget parent, string w )