Skip to content

Commit 8b0d020

Browse files
author
Bram Ceulemans
committed
fix: type check on image object passed to get_image_digest
1 parent f993c45 commit 8b0d020

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ def get_image_digest(image: Image) -> Optional[str]:
153153
:param image: the image object to get the digest out of
154154
:return: the repository digest for the given image or None if it's not present
155155
"""
156+
if not isinstance(image, Image):
157+
return None
156158
digests = image.attrs.get('RepoDigests')
157159
if digests:
158160
tag, digest = split_image(digests[0])

0 commit comments

Comments
 (0)