diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java index c6275e7b..c01467c3 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java @@ -190,7 +190,13 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe } public FeedCategory getCategoryAtPosition(int position) { - return m_adapter.getItem(position); + try { + return (FeedCategory) m_list.getItemAtPosition(position); + } catch (NullPointerException e) { + return null; + } catch (IndexOutOfBoundsException e) { + return null; + } } @Override diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java index 58560ad9..d6ddf7c9 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java @@ -856,9 +856,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh public Feed getFeedAtPosition(int position) { try { - ListView list = (ListView) getView().findViewById(R.id.feeds); - - return (Feed) list.getItemAtPosition(position); + return (Feed) m_list.getItemAtPosition(position); } catch (NullPointerException e) { return null; } catch (IndexOutOfBoundsException e) {