Fix a segmentation fault when connecting to a server without a port

fix #3260
This commit is contained in:
louiz’
2017-05-02 15:00:21 +02:00
parent ea65b43cc2
commit 0a8a77e64c
3 changed files with 15 additions and 0 deletions
+5
View File
@@ -183,6 +183,11 @@ void IrcClient::start()
{
if (this->is_connecting() || this->is_connected())
return;
if (this->ports_to_try.empty())
{
this->bridge.send_xmpp_message(this->hostname, "", "Can not connect to IRC server: no port specified.");
return;
}
std::string port;
bool tls;
std::tie(port, tls) = this->ports_to_try.top();