Calling images returns NoneType #82
-
Hi I'm trying to use the api to gain the image URL but it's returning an object of NoneType. My code can be seen below. The artist call works fine, but images throws the NoneType error at me. If you were able to help me figure out where I've gone wrong, it would be appreciated. Thanks!
|
Beta Was this translation helpful? Give feedback.
Answered by
AnssiAhola
Feb 21, 2022
Replies: 1 comment
-
Hey @DeputyBeagle Some releases do not have images attached to them. For example > 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! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
alifhughes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @DeputyBeagle
Some releases do not have images attached to them. For example
https://www.discogs.com/release/22155439-Life-On-Planets-Stay
You should maybe just add a simple null/none check
Hope that helps, Cheers!
Anssi