summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/irc/irc-command.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 9f1aa1d34..d0dca1d1f 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -958,7 +958,12 @@ IRC_COMMAND_CALLBACK(autojoin)
/* add raw channel(s) */
if (weechat_strcasecmp (argv[1], "addraw") == 0)
{
- WEECHAT_COMMAND_MIN_ARGS(3, "addraw");
+ if (argc < 3)
+ {
+ if (old_autojoin)
+ free (old_autojoin);
+ WEECHAT_COMMAND_MIN_ARGS(3, "addraw");
+ }
irc_join_add_channels_to_autojoin (ptr_server, argv_eol[2]);
goto end;
}