diff options
-rw-r--r-- | modules/core/os_news.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/modules/core/os_news.cpp b/modules/core/os_news.cpp index 878e286e6..237d5c66b 100644 --- a/modules/core/os_news.cpp +++ b/modules/core/os_news.cpp @@ -95,7 +95,7 @@ static void DisplayNews(User *u, NewsType Type) if (Type == NEWS_RANDOM && i == current_news) continue; - u->SendMessage(Global, msg, do_strftime(News[i]->time).c_str(), News[i]->Text.c_str()); + u->SendMessage(Global ? Global : NickServ, msg, do_strftime(News[i]->time).c_str(), News[i]->Text.c_str()); ++displayed; diff --git a/src/users.cpp b/src/users.cpp index b89e6c271..bf2b1b85a 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -245,6 +245,12 @@ void User::SendMessage(const Anope::string &source, const Anope::string &msg) co void User::SendMessage(BotInfo *source, LanguageString message, ...) const { + if (!source) + { + Log(LOG_DEBUG) << "Tried to send message " << message << " with nonexistant source!"; + return; + } + Anope::string m = GetString(this, message); if (Config->UseStrictPrivMsg) |