aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--irc_channel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/irc_channel.c b/irc_channel.c
index 03fe93e9..7dc9f885 100644
--- a/irc_channel.c
+++ b/irc_channel.c
@@ -115,9 +115,13 @@ irc_channel_t *irc_channel_get( irc_t *irc, char *id )
int irc_channel_free( irc_channel_t *ic )
{
- irc_t *irc = ic->irc;
+ irc_t *irc;
GSList *l;
+ if( ic == NULL )
+ return 0;
+ irc = ic->irc;
+
if( ic->flags & IRC_CHANNEL_JOINED )
irc_channel_del_user( ic, irc->user, IRC_CDU_KICK, "Cleaning up channel" );