Eight Sleep catch missing keys (#81058)

Catch missing keys
pull/81074/head
mezz64 2022-10-27 01:37:48 -04:00 committed by GitHub
parent e785d04abf
commit 24ab6fc31d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ def _get_breakdown_percent(
"""Get a breakdown percent."""
try:
return round((attr["breakdown"][key] / denominator) * 100, 2)
except ZeroDivisionError:
except (ZeroDivisionError, KeyError):
return 0