fix new error when entering an empty command in SMAPI console
This commit is contained in:
parent
7521570341
commit
703f5f89a8
|
@ -70,6 +70,9 @@ namespace StardewModdingAPI.Framework
|
|||
/// <returns>Returns whether a matching command was triggered.</returns>
|
||||
public bool Trigger(string input)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(input))
|
||||
return false;
|
||||
|
||||
string[] args = input.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
string name = args[0];
|
||||
args = args.Skip(1).ToArray();
|
||||
|
|
|
@ -575,7 +575,7 @@ namespace StardewModdingAPI
|
|||
while (true)
|
||||
{
|
||||
string input = Console.ReadLine();
|
||||
if (!this.CommandManager.Trigger(input))
|
||||
if (!string.IsNullOrWhiteSpace(input) && !this.CommandManager.Trigger(input))
|
||||
this.Monitor.Log("Unknown command; type 'help' for a list of available commands.", LogLevel.Error);
|
||||
}
|
||||
}
|
||||
|
@ -587,7 +587,6 @@ namespace StardewModdingAPI
|
|||
{
|
||||
if (arguments.Any())
|
||||
{
|
||||
|
||||
Framework.Command result = this.CommandManager.Get(arguments[0]);
|
||||
if (result == null)
|
||||
this.Monitor.Log("There's no command with that name.", LogLevel.Error);
|
||||
|
|
Loading…
Reference in New Issue