Fixed std exception in ip port parse int.

This commit is contained in:
ravinsp
2021-11-02 16:59:14 +05:30
parent c720a777ce
commit 9a87307329

View File

@@ -36,9 +36,16 @@ namespace conf
if (host_address.empty())
return -1;
port = std::stoi(split.back());
if (port == 0)
try
{
port = std::stoi(split.back());
if (port == 0)
return -1;
}
catch (...)
{
return -1;
}
return 0;
}