summaryrefslogtreecommitdiff
path: root/modules/chanserv/topic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/chanserv/topic.cpp')
-rw-r--r--modules/chanserv/topic.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/chanserv/topic.cpp b/modules/chanserv/topic.cpp
index d3546562e..005bcaf22 100644
--- a/modules/chanserv/topic.cpp
+++ b/modules/chanserv/topic.cpp
@@ -261,7 +261,9 @@ class CSTopic : public Module
/* Update channel topic */
if ((c->ci->IsTopicLock() || c->ci->IsKeepTopic()) && c->ci->GetLastTopic() != c->topic)
{
- c->ChangeTopic(!c->ci->GetLastTopicSetter().empty() ? c->ci->GetLastTopicSetter() : c->ci->WhoSends()->nick, c->ci->GetLastTopic(), c->ci->GetLastTopicTime() ? c->ci->GetLastTopicTime() : Anope::CurTime);
+ ServiceBot *sender = c->ci->WhoSends();
+ c->ChangeTopic(!c->ci->GetLastTopicSetter().empty() ? c->ci->GetLastTopicSetter() : (sender ? sender->nick : Me->GetName()),
+ c->ci->GetLastTopic(), c->ci->GetLastTopicTime() ? c->ci->GetLastTopicTime() : Anope::CurTime);
}
}
}