Skip to content

Calling images returns NoneType #82

Answered by AnssiAhola
ghost asked this question in Support
Discussion options

You must be logged in to vote

Hey @DeputyBeagle

Some releases do not have images attached to them. For example
https://www.discogs.com/release/22155439-Life-On-Planets-Stay

> release = d.release("22155439")
> print(release.images)
> None

You should maybe just add a simple null/none check

images = i.images
if images is not None:
    cover = images[0]

Hope that helps, Cheers!
Anssi

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alifhughes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant