Skip to content

Commit

Permalink
[pbh]: Fix show PBH counters when cache is partial.
Browse files Browse the repository at this point in the history
Signed-off-by: Nazarii Hnydyn <[email protected]>
  • Loading branch information
nazariig committed Jun 4, 2024
1 parent 676ebe4 commit c4b6ebd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion show/plugins/pbh.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def get_counter_value(pbh_counters, saved_pbh_counters, key, type):
if not pbh_counters[key]:
return '0'

if key in saved_pbh_counters:
if key in saved_pbh_counters and saved_pbh_counters[key]:
new_value = int(pbh_counters[key][type]) - int(saved_pbh_counters[key][type])
if new_value >= 0:
return str(new_value)
Expand Down

0 comments on commit c4b6ebd

Please sign in to comment.