From d204aa6f3195ae6cec791205bda9fbc8e0c27702 Mon Sep 17 00:00:00 2001 From: Kevin Kreiser Date: Wed, 10 Nov 2021 10:18:10 -0500 Subject: [PATCH] bail early if the statsd host is un/misconfigured --- include/cpp-statsd-client/UDPSender.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cpp-statsd-client/UDPSender.hpp b/include/cpp-statsd-client/UDPSender.hpp index c7d667a..e0b1d7b 100644 --- a/include/cpp-statsd-client/UDPSender.hpp +++ b/include/cpp-statsd-client/UDPSender.hpp @@ -181,7 +181,7 @@ inline UDPSender::UDPSender(const std::string& host, const uint64_t sendInterval) noexcept : m_host(host), m_port(port), m_batchsize(batchsize), m_sendInterval(sendInterval) { // Initialize the socket - if (!initialize()) { + if (m_host.empty() || !initialize()) { return; }