From 22bb2cdf461d7456293219fada0998acad2bfe74 Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Tue, 3 Jul 2018 09:56:22 -0700 Subject: [PATCH] Check m_port_ready_list_ref value for presense before using the value (#530) * Pospone QueueMap initialization until activation of counters * Check that port ready list has the information before referencing the information --- orchagent/bufferorch.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/orchagent/bufferorch.cpp b/orchagent/bufferorch.cpp index bfef6a49896d..f8093ee30665 100644 --- a/orchagent/bufferorch.cpp +++ b/orchagent/bufferorch.cpp @@ -85,7 +85,13 @@ bool BufferOrch::isPortReady(const std::string& port_name) const { SWSS_LOG_ENTER(); - const auto& list_of_keys = m_port_ready_list_ref.at(port_name); + const auto it = m_port_ready_list_ref.find(port_name); + if (it == m_port_ready_list_ref.cend()) + { + return false; + } + + const auto& list_of_keys = it->second; bool result = true; for (const auto& key: list_of_keys)