Release date can be null, changed model and added checks.
This commit is contained in:
parent
37f4b1da9e
commit
e17c706ae3
|
@ -43,7 +43,7 @@ class AlbumsAdapter(val context: Context?, private val listener: OnAlbumClickLis
|
|||
holder.artist.text = album.artist.name
|
||||
holder.release_date.visibility = View.GONE
|
||||
|
||||
album.release_date.split('-').getOrNull(0)?.let { year ->
|
||||
album.release_date?.split('-')?.getOrNull(0)?.let { year ->
|
||||
if (year.isNotEmpty()) {
|
||||
holder.release_date.visibility = View.VISIBLE
|
||||
holder.release_date.text = year
|
||||
|
|
|
@ -71,7 +71,7 @@ data class Album(
|
|||
val artist: Artist,
|
||||
val title: String,
|
||||
val cover: Covers,
|
||||
val release_date: String
|
||||
val release_date: String?
|
||||
) : SearchResult {
|
||||
data class Artist(val name: String)
|
||||
|
||||
|
|
Loading…
Reference in New Issue