Merge pull request #1551 from mfietz/issue/1550-npe-list-item-click

ItemListFragment: Prevent onListItemClick() NPE
This commit is contained in:
Tom Hennen 2016-01-16 14:59:21 -05:00
commit b5365e2d34
1 changed files with 3 additions and 0 deletions

View File

@ -370,6 +370,9 @@ public class ItemlistFragment extends ListFragment {
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
if(adapter == null) {
return;
}
FeedItem selection = adapter.getItem(position - l.getHeaderViewsCount());
if (selection != null) {
MainActivity activity = (MainActivity) getActivity();