From 6a5ff27dcec938944079db9a3c7772625ec4cd56 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 29 Apr 2013 21:11:24 +0400 Subject: [PATCH] fix illegalargumentexception in feed/cats sort triggered for some reason when comparator changes in prefs --- src/org/fox/ttrss/FeedCategoriesFragment.java | 6 +++++- src/org/fox/ttrss/FeedsFragment.java | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/org/fox/ttrss/FeedCategoriesFragment.java b/src/org/fox/ttrss/FeedCategoriesFragment.java index 1cf7d4e6..90889255 100644 --- a/src/org/fox/ttrss/FeedCategoriesFragment.java +++ b/src/org/fox/ttrss/FeedCategoriesFragment.java @@ -326,7 +326,11 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe } } - Collections.sort(m_cats, cmp); + try { + Collections.sort(m_cats, cmp); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } try { m_adapter.notifyDataSetChanged(); } catch (NullPointerException e) { diff --git a/src/org/fox/ttrss/FeedsFragment.java b/src/org/fox/ttrss/FeedsFragment.java index 2f5a4545..24150c68 100644 --- a/src/org/fox/ttrss/FeedsFragment.java +++ b/src/org/fox/ttrss/FeedsFragment.java @@ -542,7 +542,12 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh } } - Collections.sort(m_feeds, cmp); + try { + Collections.sort(m_feeds, cmp); + } catch (IllegalArgumentException e) { + // sort order got changed in prefs or something + e.printStackTrace(); + } try { m_adapter.notifyDataSetChanged();