mirror of
https://gitlab.shinice.net/pixeldroid/PixelDroid
synced 2024-12-25 06:23:58 +01:00
Don't assume non null: API can send bad responses
This commit is contained in:
parent
b462ed0904
commit
358e1f7323
@ -88,8 +88,8 @@ class PostFeedFragment<T: FeedContentDatabase>: CachedFeedFragment<T>() {
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
val uiModel = getItem(position) as Status
|
||||
uiModel.let {
|
||||
val uiModel = getItem(position) as Status?
|
||||
uiModel?.let {
|
||||
(holder as StatusViewHolder).bind(it, apiHolder, db, lifecycleScope, displayDimensionsInPx)
|
||||
}
|
||||
}
|
||||
|
@ -91,13 +91,10 @@ class UncachedPostsFragment : UncachedFeedFragment<Status>() {
|
||||
return StatusViewHolder.create(parent)
|
||||
}
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return R.layout.post_fragment
|
||||
}
|
||||
override fun getItemViewType(position: Int): Int = R.layout.post_fragment
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
val uiModel = getItem(position) as Status
|
||||
uiModel.let {
|
||||
getItem(position)?.let {
|
||||
(holder as StatusViewHolder).bind(it, apiHolder, db, lifecycleScope, displayDimensionsInPx)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user