Skip to content

Commit

Permalink
Merge pull request #14 from egbuna/fix/not-null-constraint
Browse files Browse the repository at this point in the history
fix: non null constraint on tv poster path
  • Loading branch information
skydoves authored Apr 25, 2020
2 parents 82c1079 + 08dddcd commit a286f35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fun bindBackDrop(view: ImageView, tv: Tv) {
Glide.with(view.context).load(Api.getBackdropPath(tv.backdrop_path))
.listener(view.requestGlideListener())
.into(view)
} else {
} else if (tv.poster_path != null) {
Glide.with(view.context).load(Api.getBackdropPath(tv.poster_path))
.listener(view.requestGlideListener())
.into(view)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ data class Tv(
var keywords: List<Keyword>? = ArrayList(),
var videos: List<Video>? = ArrayList(),
var reviews: List<Review>? = ArrayList(),
val poster_path: String,
val poster_path: String?,
val popularity: Float,
val backdrop_path: String?,
val vote_average: Float,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class TvListViewHolder constructor(
item_poster_title.text = tv.name
tv.poster_path.let {
Glide.with(context)
.load(Api.getPosterPath(it))
.load(Api.getPosterPath(it!!))
.listener(GlidePalette.with(Api.getPosterPath(it))
.use(BitmapPalette.Profile.VIBRANT)
.intoBackground(item_poster_palette)
Expand Down

0 comments on commit a286f35

Please sign in to comment.