fix crash when opening context menu on feed/cats fragments w/ header (2)
This commit is contained in:
parent
1e0a0387ca
commit
8dc231e8cc
@ -190,7 +190,13 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
public FeedCategory getCategoryAtPosition(int position) {
|
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
|
@Override
|
||||||
|
@ -856,9 +856,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
|||||||
|
|
||||||
public Feed getFeedAtPosition(int position) {
|
public Feed getFeedAtPosition(int position) {
|
||||||
try {
|
try {
|
||||||
ListView list = (ListView) getView().findViewById(R.id.feeds);
|
return (Feed) m_list.getItemAtPosition(position);
|
||||||
|
|
||||||
return (Feed) list.getItemAtPosition(position);
|
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
return null;
|
return null;
|
||||||
} catch (IndexOutOfBoundsException e) {
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user