I'm using google books api to get some data as json response. in the response, there are JSONArrays, each element is a book and it contains data about it. the problem is the elements should be symmetric when it comes to the data they contain. in other words, each element should contain a title, authors, book cover url, rating and so on. and when a book doesn't contain ,for example, a rating, this value should exist and be empty but it doesn't exist at all for that element so in the for loop it throws an exception
so what should i do to avoid such a problem and i do need that data even if it's empty.
the other part is there is a url for the cover of the book provided in the response. i want to get that image. i tried both top answers in this link and non of them seemed to work.