From 2a886acbedb6b6386dbff3e591b0d4035d516b2a Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 19 Mar 2017 18:36:03 -0400 Subject: Get rid of relying on if(this) in WhoSends() --- modules/protocol/unreal.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'modules/protocol') diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index fd6e31875..0bca595df 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -104,10 +104,16 @@ void unreal::senders::MessageChannel::Send(Channel* c) /* Unreal does not support updating a channels TS without actually joining a user, * so we will join and part us now */ - ServiceBot *bi = c->ci->WhoSends(); + ServiceBot *bi; + if (c->ci) + bi = c->ci->WhoSends(); + else + bi = Config->GetClient("ChanServ"); + if (!bi) - ; - else if (c->FindUser(bi) == NULL) + return; + + if (c->FindUser(bi) == NULL) { bi->Join(c); bi->Part(c); -- cgit