cwac-merge
cwac-merge copied to clipboard
throw exception if position is invalid in getView
if due to stupidity of programmer the adapter is requesting a view to be displayed in an invalid position i.e. position > getCount() == true
the method returns null and passes the issue to other places in the system
In my case, there was a location in which I forgot to call notifyDatasetInvalidated()
when the adapter cleared the data and scrolling in the invalid list wold cause an issue in android.widget.HeaderViewListAdapter.isEnabled
instead of throwing it in the initial getView.
I suggest adding a validation of position and an exception instead of returning null and letting the system crash.