diff --git a/src/clientrpc.cpp b/src/clientrpc.cpp index 9ba7060a1d..1f6671ca9e 100644 --- a/src/clientrpc.cpp +++ b/src/clientrpc.cpp @@ -190,18 +190,15 @@ CClientRpc::CClientRpc ( CClient* pClient, CClientSettings* pSettings, CRpcServe CHostAddress haDirectoryAddress; // Allow IPv4 only for communicating with Directories - if ( NetworkUtil::ParseNetworkAddress ( jsonDirectoryIp.toString(), haDirectoryAddress, false ) ) - { - // send the request for the server list - pClient->CreateCLReqServerListMes ( haDirectoryAddress ); - response["result"] = "ok"; - } - else + if ( !NetworkUtil::ParseNetworkAddress ( jsonDirectoryIp.toString(), haDirectoryAddress, false ) ) { response["error"] = CRpcServer::CreateJsonRpcError ( CRpcServer::iErrInvalidParams, "Invalid params: directory is not a valid socket address" ); + return; } + // send the request for the server list + pClient->CreateCLReqServerListMes ( haDirectoryAddress ); response["result"] = "ok"; } );