make CncLobbyLogic tolerant of missing music button

This commit is contained in:
Chris Forbes
2011-11-06 11:38:44 +13:00
parent 40b89d177f
commit c20d71c9af

View File

@@ -190,13 +190,10 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
chatTemplate = chatPanel.GetWidget("CHAT_TEMPLATE"); chatTemplate = chatPanel.GetWidget("CHAT_TEMPLATE");
chatPanel.RemoveChildren(); chatPanel.RemoveChildren();
lobby.GetWidget<ButtonWidget>("MUSIC_BUTTON").OnClick = () => var musicButton = lobby.GetWidget<ButtonWidget>("MUSIC_BUTTON");
{ if (musicButton != null)
Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs() musicButton.OnClick = () => Widget.OpenWindow("MUSIC_PANEL", new WidgetArgs
{ { { "onExit", () => {} } });
{ "onExit", () => {} },
});
};
// Add a bot on the first lobbyinfo update // Add a bot on the first lobbyinfo update
if (addBots) if (addBots)