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"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="org.fox.ttrss"
|
package="org.fox.ttrss"
|
||||||
android:versionCode="444"
|
android:versionCode="445"
|
||||||
android:versionName="1.210">
|
android:versionName="1.211">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
@ -52,14 +52,19 @@ public class ArticlePager extends Fragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(int position) {
|
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);
|
|
||||||
|
|
||||||
return af;
|
if (article != null) {
|
||||||
|
ArticleFragment af = new ArticleFragment();
|
||||||
|
af.initialize(article);
|
||||||
|
|
||||||
|
return af;
|
||||||
|
}
|
||||||
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user