diff --git a/src/app/clusters/bindings/PendingNotificationMap.h b/src/app/clusters/bindings/PendingNotificationMap.h index fad96ea78cbb74..897749325e1baa 100644 --- a/src/app/clusters/bindings/PendingNotificationMap.h +++ b/src/app/clusters/bindings/PendingNotificationMap.h @@ -38,11 +38,8 @@ class PendingNotificationContext void IncrementConsumersNumber() { mConsumersNumber++; } void DecrementConsumersNumber() { - if (mConsumersNumber > 0) - { - mConsumersNumber--; - } - else + VerifyOrDie(mConsumersNumber > 0); + if (--mConsumersNumber == 0) { // Release the context only if there is no pending notification pointing to it context. if (mPendingNotificationContextReleaseHandler != nullptr)