src/channel: fix possible null reference in joining

This commit is contained in:
Sam Dodrill 2014-03-09 15:29:23 -07:00
parent c649e42ae9
commit be813f8605
1 changed files with 8 additions and 9 deletions

View File

@ -2003,7 +2003,6 @@ void user_join(struct Client * client_p, struct Client * source_p, const char *
/* we send the user their join here, because we could have to
* send a mode out next.
*/
sendto_channel_local_with_capability(ALL_MEMBERS, NOCAPS, CLICAP_EXTENDED_JOIN, chptr, ":%s!%s@%s JOIN %s",
source_p->name, source_p->username, source_p->host, chptr->chname);
@ -2013,7 +2012,7 @@ void user_join(struct Client * client_p, struct Client * source_p, const char *
source_p->tsinfo, source_p->info);
/* Send away message to away-notify enabled clients. */
if (client_p->user->away)
if (client_p->user && client_p->user->away)
sendto_channel_local_with_capability_butone(client_p, ALL_MEMBERS, CLICAP_AWAY_NOTIFY, NOCAPS, chptr,
":%s!%s@%s AWAY :%s", client_p->name, client_p->username,
client_p->host, client_p->user->away);