add some index out of bounds checks to feeds/headline fragments
This commit is contained in:
parent
1e0f877b37
commit
7e08d4132f
@ -544,6 +544,10 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
||||
}
|
||||
|
||||
public Feed getFeedAtPosition(int position) {
|
||||
try {
|
||||
return m_adapter.getItem(position);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -519,7 +519,11 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
}
|
||||
|
||||
public Article getArticleAtPosition(int position) {
|
||||
try {
|
||||
return m_adapter.getItem(position);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Article getArticleById(int id) {
|
||||
|
Loading…
Reference in New Issue
Block a user