diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d108c9d..f1a85365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed /savessc not bothering to save ssc data for people who bypass ssc. (@hakusaro) * Default permission sets for new databases are more modern. (@hakusaro) * Added the ability to ban by account name instead of just banning a character name assuming its an account name. (@hakusaro) +* Fixed a bug in the CommandLineParser which caused some command lines to fail (@QuicM) * Renamed TShock.DB.User to TShock.DB.UserAccount, including all the related methods, classes and events. (@Ryozuki) * Update OTAPI to 2.0.0.31, which also updates Newtonsoft.Json to 10.0.3 (@Ryozuki) * Fixed DumpItems() from trying to dump older versions of certain items (negative item IDs). (@Zaicon) diff --git a/TShockAPI/CLI/CommandLineParser.cs b/TShockAPI/CLI/CommandLineParser.cs index 7106abbe..d84a7732 100644 --- a/TShockAPI/CLI/CommandLineParser.cs +++ b/TShockAPI/CLI/CommandLineParser.cs @@ -165,10 +165,16 @@ namespace TShockAPI.CLI { _source = source; - for (int i = 0; i < (source.Length - 1 == 0 ? 1 : source.Length - 1); i++) + for (int i = 0; i < (source.Length - 1 == 0 ? 1 : source.Length); i++) { string flag = source[i].ToLowerInvariant(); string argument = null; + + if (string.IsNullOrWhiteSpace(flag)) + { + continue; + } + if (i + 1 < source.Length) { argument = source[i + 1];