From 5bffe2e304a169a606b83c731909e5a71c2e758b Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Sat, 2 Sep 2017 22:44:16 -0400 Subject: [PATCH] Fix infinite listing --- TGServerService/ChatCommands.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TGServerService/ChatCommands.cs b/TGServerService/ChatCommands.cs index 55b92365f5..1025066cc2 100644 --- a/TGServerService/ChatCommands.cs +++ b/TGServerService/ChatCommands.cs @@ -65,12 +65,12 @@ namespace TGServerService class RootChatCommand : RootCommand { public RootChatCommand(List serverCommands) - { - if (serverCommands == null) - serverCommands = new List(); + { + Children = new Command[] { new PRsCommand(), new VersionCommand(), new RevisionCommand(), new ByondCommand(), new KekCommand() }; + if (serverCommands != null) + serverCommands.CopyTo(Children); + serverCommands = new List(); PrintHelpList = true; - serverCommands.AddRange(new Command[] { new PRsCommand(), new VersionCommand(), new RevisionCommand(), new ByondCommand(), new KekCommand() }); - Children = serverCommands.ToArray(); } } class RevisionCommand : ChatCommand