From 28a66c33a814597e2344844e99cae5303585d934 Mon Sep 17 00:00:00 2001 From: Teodora Sechkova Date: Wed, 16 Jun 2021 16:23:44 +0300 Subject: [PATCH] Check snapshot value for None For consistency with the rest if the checks. Signed-off-by: Teodora Sechkova --- tuf/ngclient/_internal/metadata_bundle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuf/ngclient/_internal/metadata_bundle.py b/tuf/ngclient/_internal/metadata_bundle.py index bf4bf3ed5a..e0aea551e0 100644 --- a/tuf/ngclient/_internal/metadata_bundle.py +++ b/tuf/ngclient/_internal/metadata_bundle.py @@ -359,7 +359,7 @@ def update_snapshot(self, data: bytes): # pylint: disable=too-many-branches # If an existing trusted snapshot is updated, # check for a rollback attack - if self.snapshot: + if self.snapshot is not None: for filename, fileinfo in self.snapshot.signed.meta.items(): new_fileinfo = new_snapshot.signed.meta.get(filename)