Skip to content

Commit

Permalink
[pfcwd]: delete pfcwd handler only when it exists (sonic-net#442)
Browse files Browse the repository at this point in the history
Signed-off-by: Sihui Han <sihan@microsoft.com>
  • Loading branch information
sihuihan88 authored Feb 2, 2018
1 parent 4227bee commit 6b2a591
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions orchagent/pfcwdorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,11 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::doTask(swss::NotificationConsumer
}
else if (event == "restore")
{
entry->second.handler->commitCounters();
entry->second.handler = nullptr;
if (entry->second.handler != nullptr)
{
entry->second.handler->commitCounters();
entry->second.handler = nullptr;
}
}
else
{
Expand Down

0 comments on commit 6b2a591

Please sign in to comment.