mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
fix crash on delayed context menu taps on feeds
This commit is contained in:
parent
d79be508d4
commit
85971b6f0d
2 changed files with 7 additions and 2 deletions
|
@ -736,6 +736,8 @@ public class FolderListAdapter extends BaseExpandableListAdapter {
|
|||
|
||||
/** Get the cached Feed object for the feed at the given list location. */
|
||||
public synchronized Feed getFeed(int groupPosition, int childPosition) {
|
||||
if (groupPosition > activeFolderChildren.size()) return null;
|
||||
if (childPosition > activeFolderChildren.get(groupPosition).size()) return null;
|
||||
return activeFolderChildren.get(groupPosition).get(childPosition);
|
||||
}
|
||||
|
||||
|
|
|
@ -346,8 +346,11 @@ public class FolderListFragment extends NbFragment implements OnCreateContextMen
|
|||
markFeedsAsRead(fs);
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.menu_choose_folders) {
|
||||
DialogFragment chooseFoldersFragment = ChooseFoldersFragment.newInstance(adapter.getFeed(groupPosition, childPosition));
|
||||
chooseFoldersFragment.show(getFragmentManager(), "dialog");
|
||||
Feed feed = adapter.getFeed(groupPosition, childPosition);
|
||||
if (feed != null) {
|
||||
DialogFragment chooseFoldersFragment = ChooseFoldersFragment.newInstance(feed);
|
||||
chooseFoldersFragment.show(getFragmentManager(), "dialog");
|
||||
}
|
||||
} else if (item.getItemId() == R.id.menu_mute_feed) {
|
||||
Set<String> feedIds = new HashSet<String>();
|
||||
feedIds.add(adapter.getFeed(groupPosition, childPosition).feedId);
|
||||
|
|
Loading…
Add table
Reference in a new issue