Skip to content

Commit

Permalink
fix: type check on image object passed to get_image_digest
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram Ceulemans committed Jul 29, 2020
1 parent f993c45 commit 8b0d020
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ def get_image_digest(image: Image) -> Optional[str]:
:param image: the image object to get the digest out of
:return: the repository digest for the given image or None if it's not present
"""
if not isinstance(image, Image):
return None
digests = image.attrs.get('RepoDigests')
if digests:
tag, digest = split_image(digests[0])
Expand Down

0 comments on commit 8b0d020

Please sign in to comment.