Skip to content

throw exception if position is invalid in getView #22

@yishai-glide

Description

@yishai-glide

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions