From 6b2a5910ee07c6a50697a115e07532a46dfba3f0 Mon Sep 17 00:00:00 2001 From: sihuihan88 Date: Fri, 2 Feb 2018 15:17:47 -0800 Subject: [PATCH] [pfcwd]: delete pfcwd handler only when it exists (#442) Signed-off-by: Sihui Han --- orchagent/pfcwdorch.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/orchagent/pfcwdorch.cpp b/orchagent/pfcwdorch.cpp index 83548d7dda4d..09b954320922 100644 --- a/orchagent/pfcwdorch.cpp +++ b/orchagent/pfcwdorch.cpp @@ -626,8 +626,11 @@ void PfcWdSwOrch::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 {