From d4195b31a24805aac38ef006c099d60228980d34 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 26 Apr 2000 10:13:29 +0000 Subject: [PATCH] crashed with servers that didn't automatically set any user mode git-svn-id: http://svn.irssi.org/repos/irssi/trunk@177 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/irc-server.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/irc/core/irc-server.c b/src/irc/core/irc-server.c index a02181e6..2f9e9fb1 100644 --- a/src/irc/core/irc-server.c +++ b/src/irc/core/irc-server.c @@ -336,8 +336,9 @@ static int sig_set_user_mode(IRC_SERVER_REC *server) return 0; /* got disconnected */ mode = settings_get_str("default_user_mode"); - newmode = modes_join(server->usermode, mode); - if (strcmp(newmode, server->usermode) != 0) + newmode = server->usermode == NULL ? NULL : + modes_join(server->usermode, mode); + if (server->usermode == NULL || strcmp(newmode, server->usermode) != 0) irc_send_cmdv(server, "MODE %s %s", server->nick, mode); g_free(newmode); return 0;