From 97532cfafb24c47e7a8ae0b489fbbf0e9cbceb0b Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 8 Jan 2012 16:41:26 +0100 Subject: [PATCH] Fix assertion failure when failing to join a channel and there is no forward. This was harmless apart from the message. --- modules/core/m_join.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/m_join.c b/modules/core/m_join.c index c7c04b5b..7b8193a7 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -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++; }