From f88f49471a1f3f0664d8f5323983a97cd9297e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Fri, 23 Sep 2022 14:02:51 -0600 Subject: [PATCH] Fix crash due to empty channel name --- src/strategy/actions/SuggestWhatToDoAction.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/strategy/actions/SuggestWhatToDoAction.cpp b/src/strategy/actions/SuggestWhatToDoAction.cpp index 29576b1e..6846e5c6 100644 --- a/src/strategy/actions/SuggestWhatToDoAction.cpp +++ b/src/strategy/actions/SuggestWhatToDoAction.cpp @@ -186,7 +186,10 @@ void SuggestWhatToDoAction::spam( { strToLower(msg); } - chn->Say(bot->GetGUID(), msg.c_str(), LANG_UNIVERSAL); + if (chn->GetName().length() > 0) + { + chn->Say(bot->GetGUID(), msg.c_str(), LANG_UNIVERSAL); + } } } }