Skip to content

Commit

Permalink
Check m_port_ready_list_ref value for presense before using the value (
Browse files Browse the repository at this point in the history
…sonic-net#530)

* Pospone QueueMap initialization until activation of counters

* Check that port ready list has the information before referencing the information
  • Loading branch information
pavel-shirshov authored and lguohan committed Jul 3, 2018
1 parent 23bb493 commit 22bb2cd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion orchagent/bufferorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 22bb2cd

Please sign in to comment.