diff options
author | LemonBoy <thatlemon@gmail.com> | 2016-03-18 20:18:58 +0100 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2016-03-19 14:04:53 +0100 |
commit | 6745dd6159afc6ff220d09d7adc1923218fa756b (patch) | |
tree | ed7c3222c31506efef15053e39ce4b03b9fd3317 /src/core/chat-commands.c | |
parent | 795b7de80891d51adfb912798ca954431cbf702b (diff) | |
download | irssi-6745dd6159afc6ff220d09d7adc1923218fa756b.zip |
Throw an error when a chatnet has no available url
If you type /connect <CN> and the chatnet <CN> has no url available
let's just throw an error instead of trying to process <CN> as a url.
Diffstat (limited to 'src/core/chat-commands.c')
-rw-r--r-- | src/core/chat-commands.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/chat-commands.c b/src/core/chat-commands.c index 7f000cf5..a9404fa3 100644 --- a/src/core/chat-commands.c +++ b/src/core/chat-commands.c @@ -73,6 +73,13 @@ static SERVER_CONNECT_REC *get_server_connect(const char *data, int *plus_addr, conn = server_create_conn(proto != NULL ? proto->id : -1, addr, atoi(portstr), chatnet, password, nick); + if (conn == NULL) { + signal_emit("error command", 1, + GINT_TO_POINTER(CMDERR_NO_SERVER_DEFINED)); + cmd_params_free(free_arg); + return NULL; + } + if (proto == NULL) proto = chat_protocol_find_id(conn->chat_type); |