From 60937b096bc535aea2da1a6dfda9b4d3a6c275ac Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 8 Mar 2015 17:15:00 +0000 Subject: [PATCH] Give a sensible error if LoadScreen/LobbyDefaults is missing. --- OpenRA.Game/Manifest.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Manifest.cs b/OpenRA.Game/Manifest.cs index b01f8f7f14..5c9c5bf591 100644 --- a/OpenRA.Game/Manifest.cs +++ b/OpenRA.Game/Manifest.cs @@ -92,8 +92,12 @@ namespace OpenRA Missions = YamlList(yaml, "Missions", true); ServerTraits = YamlList(yaml, "ServerTraits"); - LoadScreen = yaml["LoadScreen"]; - LobbyDefaults = yaml["LobbyDefaults"]; + + if (!yaml.TryGetValue("LoadScreen", out LoadScreen)) + throw new InvalidDataException("`LoadScreen` section is not defined."); + + if (!yaml.TryGetValue("LobbyDefaults", out LobbyDefaults)) + throw new InvalidDataException("`LobbyDefaults` section is not defined."); Fonts = yaml["Fonts"].ToDictionary(my => {