diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-07-25 15:26:41 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-07-25 15:26:41 +0000 |
commit | 2f6a4140d6efdfddbbbc97b6a83c0eca43075b4a (patch) | |
tree | eea42a6c2e3ceea643043d23abc57e3f52595fe1 /src/irc/irc-send.c | |
parent | 9909adc0a44f8587260cdab4bff695e650ea6907 (diff) | |
download | weechat-2f6a4140d6efdfddbbbc97b6a83c0eca43075b4a.zip |
Fixed crash when doing "/part something" on a server buffer (bug #17201)
Diffstat (limited to 'src/irc/irc-send.c')
-rw-r--r-- | src/irc/irc-send.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c index 236c5d9e6..785f44369 100644 --- a/src/irc/irc-send.c +++ b/src/irc/irc-send.c @@ -1532,17 +1532,25 @@ irc_cmd_send_part (t_irc_server *server, t_irc_channel *channel, } else { + if (!CHANNEL(buffer)) + { + irc_display_prefix (NULL, server->buffer, PREFIX_ERROR); + gui_printf_nolog (server->buffer, + _("%s \"%s\" command can only be executed in a channel or private buffer\n"), + WEECHAT_ERROR, "part"); + return -1; + } channel_name = CHANNEL(buffer)->name; pos_args = arguments; } } else { - if (BUFFER_IS_SERVER(buffer)) + if (!CHANNEL(buffer)) { irc_display_prefix (NULL, server->buffer, PREFIX_ERROR); gui_printf_nolog (server->buffer, - _("%s \"%s\" command can not be executed on a server buffer\n"), + _("%s \"%s\" command can only be executed in a channel or private buffer\n"), WEECHAT_ERROR, "part"); return -1; } |