diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index a4eca1f1..32f911a2 100644 --- a/src/ngircd/channel.c +++ b/src/ngircd/channel.c @@ -218,11 +218,16 @@ Channel_Part(CLIENT * Client, CLIENT * Origin, const char *Name, const char *Rea assert(Reason != NULL); chan = Channel_Search(Name); - if ((!chan) || (!Get_Cl2Chan(chan, Client))) { + if (!chan) { IRC_WriteStrClient(Client, ERR_NOSUCHCHANNEL_MSG, Client_ID(Client), Name); return false; } + if (!Get_Cl2Chan(chan, Client)) { + IRC_WriteStrClient(Client, ERR_NOTONCHANNEL_MSG, + Client_ID(Client), Name); + return false; + } if (!Remove_Client(REMOVE_PART, chan, Client, Origin, Reason, true)) return false;