Fix assertion failure when failing to join a channel and there is no forward.

This was harmless apart from the message.
This commit is contained in:
Jilles Tjoelker 2012-01-08 16:41:26 +01:00
parent 1c60de9757
commit 97532cfafb

View file

@ -106,6 +106,8 @@ check_forward(struct Client *source_p, struct Channel *chptr,
while (depth < 16)
{
if (next == NULL)
return NULL;
chptr = find_channel(next);
/* Can only forward to existing channels */
if (chptr == NULL)
@ -122,8 +124,6 @@ check_forward(struct Client *source_p, struct Channel *chptr,
i = can_join(source_p, chptr, key, &next);
if (i == 0)
return chptr;
if (next == NULL)
return NULL;
depth++;
}