diff --git a/src/Common/Parser.cpp b/src/Common/Parser.cpp index 6f9dc810..f57fcca3 100644 --- a/src/Common/Parser.cpp +++ b/src/Common/Parser.cpp @@ -212,6 +212,7 @@ static void inline checkHost(std::string &host) { } void splitUrl(const std::string &url, std::string &host, uint16_t &port) { + CHECK(!url.empty(), "empty url"); auto pos = url.rfind(':'); if (pos == string::npos || url.back() == ']') { //没有冒号,未指定端口;或者是纯粹的ipv6地址