Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ViewDelegate#getAdapterPosition NPE #315

Closed
drakeet opened this issue Mar 4, 2021 · 0 comments
Closed

ViewDelegate#getAdapterPosition NPE #315

drakeet opened this issue Mar 4, 2021 · 0 comments
Assignees
Labels

Comments

@drakeet
Copy link
Owner

drakeet commented Mar 4, 2021

  • MultiType version: 4.2.0
Process: me.drakeet.multitype.sample, PID: 22343
java.lang.NullPointerException: Attempt to invoke virtual method 'int androidx.recyclerview.widget.RecyclerView$ViewHolder.getLayoutPosition()' on a null object reference
    at androidx.recyclerview.widget.RecyclerView$LayoutParams.getViewLayoutPosition(RecyclerView.java:11701)
    at com.drakeet.multitype.ViewDelegate.getLayoutPosition(ViewDelegate.kt:41)
    at com.drakeet.multitype.sample.normal.RichViewDelegate.onBindView(RichViewDelegate.kt:40)
    at com.drakeet.multitype.sample.normal.RichViewDelegate.onBindView(RichViewDelegate.kt:32)
    at com.drakeet.multitype.ViewDelegate.onBindView(ViewDelegate.kt:26)
    at com.drakeet.multitype.ViewDelegate.onBindViewHolder(ViewDelegate.kt:33)
    at com.drakeet.multitype.ViewDelegate.onBindViewHolder(ViewDelegate.kt:13)
    at com.drakeet.multitype.ItemViewDelegate.onBindViewHolder(ItemViewDelegate.kt:105)
    at com.drakeet.multitype.MultiTypeAdapter.onBindViewHolder(MultiTypeAdapter.kt:148)
    at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
    at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6012)
    at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6279)
    at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
    at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
    at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
    at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
    at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
    at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
    at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
    at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
    at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
@drakeet drakeet added the bug label Mar 4, 2021
@drakeet drakeet self-assigned this Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant