Skip to content

Commit

Permalink
Handle KeyError when loading backups (home-assistant#70028)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored and balloob committed Apr 14, 2022
1 parent 8bdce8e commit e01faa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion homeassistant/components/backup/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _read_backups(self) -> dict[str, Backup]:
size=round(backup_path.stat().st_size / 1_048_576, 2),
)
backups[backup.slug] = backup
except (OSError, TarError, json.JSONDecodeError) as err:
except (OSError, TarError, json.JSONDecodeError, KeyError) as err:
LOGGER.warning("Unable to read backup %s: %s", backup_path, err)
return backups

Expand Down

0 comments on commit e01faa7

Please sign in to comment.