articlepager.getitem: handle index out of bounds (not sure how would pager respond but w/e)
This commit is contained in:
parent
5d746b07f0
commit
d5871ce245
@ -2,8 +2,8 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.fox.ttrss"
|
||||
android:versionCode="444"
|
||||
android:versionName="1.210">
|
||||
android:versionCode="445"
|
||||
android:versionName="1.211">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
@ -52,14 +52,19 @@ public class ArticlePager extends Fragment {
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
Article article = m_articles.get(position);
|
||||
try {
|
||||
Article article = m_articles.get(position);
|
||||
|
||||
if (article != null) {
|
||||
ArticleFragment af = new ArticleFragment();
|
||||
af.initialize(article);
|
||||
if (article != null) {
|
||||
ArticleFragment af = new ArticleFragment();
|
||||
af.initialize(article);
|
||||
|
||||
return af;
|
||||
return af;
|
||||
}
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user