Skip to content

Commit 6b2a591

Browse files
authored
[pfcwd]: delete pfcwd handler only when it exists (sonic-net#442)
Signed-off-by: Sihui Han <[email protected]>
1 parent 4227bee commit 6b2a591

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

orchagent/pfcwdorch.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,11 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::doTask(swss::NotificationConsumer
626626
}
627627
else if (event == "restore")
628628
{
629-
entry->second.handler->commitCounters();
630-
entry->second.handler = nullptr;
629+
if (entry->second.handler != nullptr)
630+
{
631+
entry->second.handler->commitCounters();
632+
entry->second.handler = nullptr;
633+
}
631634
}
632635
else
633636
{

0 commit comments

Comments
 (0)