summaryrefslogtreecommitdiff
path: root/src/bots.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bots.cpp')
-rw-r--r--src/bots.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bots.cpp b/src/bots.cpp
index 35b390ed4..eaa0d045d 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -139,12 +139,13 @@ void ServiceBot::UnAssign(User *u, ChanServ::Channel *ci)
if (MOD_RESULT == EVENT_STOP)
return;
- if (ci->c && ci->c->FindUser(ci->GetBot()))
+ Channel *c = ci->GetChannel();
+ if (c && c->FindUser(ci->GetBot()))
{
if (u)
- ci->GetBot()->Part(ci->c, "UNASSIGN from " + u->nick);
+ ci->GetBot()->Part(c, "UNASSIGN from " + u->nick);
else
- ci->GetBot()->Part(ci->c);
+ ci->GetBot()->Part(c);
}
ci->SetBot(nullptr);