From ccf32fea209206537754e1457fbe136996ac6b39 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 27 Dec 2018 22:28:21 +0200 Subject: [PATCH] Fixed crashing when entering a space in the console and then attempting to autocomplete. Closes #977 --- Barotrauma/BarotraumaShared/Source/DebugConsole.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs index 84ab3289c..77271473e 100644 --- a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs @@ -1833,7 +1833,7 @@ namespace Barotrauma string[] args = splitCommand.Skip(1).ToArray(); //if an argument is given or the last character is a space, attempt to autocomplete the argument - if (args.Length > 0 || (command.Length > 0 && command.Last() == ' ')) + if (args.Length > 0 || (splitCommand.Length > 0 && command.Last() == ' ')) { Command matchingCommand = commands.Find(c => c.names.Contains(splitCommand[0])); if (matchingCommand == null || matchingCommand.GetValidArgs == null) return command;