carrot / recycler-core

Multiple view type handling in RecyclerViews with 90% less tears
25 stars 1 forks source link

Crash when setting Adapter #37

Closed roideuniverse closed 8 years ago

roideuniverse commented 8 years ago

When the RecyclerViewLayout is instantiated dynamically, using

mProgressRecyclerViewLayout = new ProgressRecyclerViewLayout(getContext());
LinearLayoutManager manager = new LinearLayoutManager(getContext());
manager.setOrientation(LinearLayoutManager.VERTICAL);

it crashes when setting the adapter with trace as

Caused by: java.lang.NullPointerException: 
Attempt to invoke virtual method 'void com.carrotcreative.recyclercore.widget.RecyclerCoreRecyclerView.setVisibility(int)' on a null object reference

at com.carrotcreative.recyclercore.widget.ProgressRecyclerViewLayout.resetViewVisibility(ProgressRecyclerViewLayout.java:364)

at com.carrotcreative.recyclercore.widget.ProgressRecyclerViewLayout.setAdapter(ProgressRecyclerViewLayout.java:113)