diff --git a/src/org/fox/ttrss/FeedsFragment.java b/src/org/fox/ttrss/FeedsFragment.java index bb823dd0..430194e5 100644 --- a/src/org/fox/ttrss/FeedsFragment.java +++ b/src/org/fox/ttrss/FeedsFragment.java @@ -544,6 +544,10 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh } public Feed getFeedAtPosition(int position) { - return m_adapter.getItem(position); + try { + return m_adapter.getItem(position); + } catch (IndexOutOfBoundsException e) { + return null; + } } } diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index 0e7b718f..6c66b3aa 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -519,7 +519,11 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, } public Article getArticleAtPosition(int position) { - return m_adapter.getItem(position); + try { + return m_adapter.getItem(position); + } catch (IndexOutOfBoundsException e) { + return null; + } } public Article getArticleById(int id) {