fix: don't accept empty arguments for chat muting

This commit is contained in:
goat 2020-05-11 22:57:56 +02:00
parent 5a049383f1
commit eeab6a7135
2 changed files with 6 additions and 1 deletions

View file

@ -502,6 +502,11 @@ namespace Dalamud {
if (this.Configuration.BadWords == null)
this.Configuration.BadWords = new List<string>();
if (string.IsNullOrEmpty(arguments)) {
Framework.Gui.Chat.Print(Loc.Localize("DalamudMuteNoArgs", "Please provide a word to mute."));
return;
}
this.Configuration.BadWords.Add(arguments);
this.Configuration.Save();

View file

@ -110,7 +110,7 @@ namespace Dalamud.Game {
if (this.dalamud.Configuration.BadWords != null &&
this.dalamud.Configuration.BadWords.Any(x => textVal.Contains(x)))
this.dalamud.Configuration.BadWords.Any(x => !string.IsNullOrEmpty(x) && textVal.Contains(x)))
{
// This seems to be in the user block list - let's not show it
Log.Debug("Blocklist triggered");