federicoiosue / Omni-Notes

Open source note-taking application for Android
https://omninotes.app
GNU General Public License v3.0
2.67k stars 1.11k forks source link

Crash while choosing category #741

Closed tappdesign closed 4 years ago

tappdesign commented 4 years ago

In current develop branch is issue with nullpointer exception while choosing the category.

The problem is in CategoryRecyclerViewAdapter.java --> .txtTitle. is NULL

@Override
  public void onBindViewHolder (@NonNull CategoryViewHolder holder, int position) {
    Category category = categories.get(position);

    holder.txtTitle.setText(category.getName());     --> crash here

LOG

E/ACRA: ACRA caught a NullPointerException for it.feio.android.omninotes.alpha
    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.neopixl.pixlui.components.textview.TextView.setText(java.lang.CharSequence)' on a null object reference
        at it.feio.android.omninotes.models.adapters.CategoryRecyclerViewAdapter.onBindViewHolder(CategoryRecyclerViewAdapter.java:74)
        at it.feio.android.omninotes.models.adapters.CategoryRecyclerViewAdapter.onBindViewHolder(CategoryRecyclerViewAdapter.java:41)
        at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
        at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
        at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
        at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
        at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
        at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
        at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
        at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
        at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
        at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
        at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
        at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3336)
        at android.view.View.measure(View.java:22216)