diff --git a/RecrownedAthenaeum.ConsoleTools/CommandProcessor/EngineCommand.cs b/RecrownedAthenaeum.ConsoleTools/CommandProcessor/EngineCommand.cs index 4a272cd..ff9c21e 100644 --- a/RecrownedAthenaeum.ConsoleTools/CommandProcessor/EngineCommand.cs +++ b/RecrownedAthenaeum.ConsoleTools/CommandProcessor/EngineCommand.cs @@ -89,14 +89,17 @@ namespace RecrownedAthenaeum.Tools.CommandProcessor /// The index or throws argument exception if it doesn't exist. public int IndexOfArgumentIn(string argument, string[] arguments) { - for (int i = 0; i < arguments.Length; i++) + if (arguments != null) { - if (arguments[i] == argument) + for (int i = 0; i < arguments.Length; i++) { - return i; + if (arguments[i] == argument) + { + return i; + } } } - throw new ArgumentException("Argument " + argument + " is missing. Type \"help\" for more information."); + throw new ArgumentException("Expected argument " + argument + " is missing. Type \"help\" for more information."); } public bool HasArgument(string argument, string[] arguments)