add a catch block against possible crashes with excerpt handling
This commit is contained in:
parent
62de61c5a0
commit
d61997e20e
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.fox.ttrss"
|
package="org.fox.ttrss"
|
||||||
android:versionCode="375"
|
android:versionCode="376"
|
||||||
android:versionName="1.147" >
|
android:versionName="1.148" >
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="15"
|
android:minSdkVersion="15"
|
||||||
|
@ -1045,17 +1045,22 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
|||||||
} else {
|
} else {
|
||||||
String excerpt;
|
String excerpt;
|
||||||
|
|
||||||
if (m_activity.getApiLevel() >= 11) {
|
try {
|
||||||
excerpt = article.excerpt != null ? article.excerpt : "";
|
if (m_activity.getApiLevel() >= 11) {
|
||||||
excerpt = excerpt.replace("…", "…");
|
excerpt = article.excerpt != null ? article.excerpt : "";
|
||||||
excerpt = excerpt.replace("]]>", "");
|
excerpt = excerpt.replace("…", "…");
|
||||||
excerpt = Jsoup.parse(excerpt).text();
|
excerpt = excerpt.replace("]]>", "");
|
||||||
} else {
|
excerpt = Jsoup.parse(excerpt).text();
|
||||||
excerpt = article.articleDoc.text();
|
} else {
|
||||||
|
excerpt = article.articleDoc.text();
|
||||||
|
|
||||||
if (excerpt.length() > CommonActivity.EXCERPT_MAX_LENGTH)
|
if (excerpt.length() > CommonActivity.EXCERPT_MAX_LENGTH)
|
||||||
excerpt = excerpt.substring(0, CommonActivity.EXCERPT_MAX_LENGTH) + "…";
|
excerpt = excerpt.substring(0, CommonActivity.EXCERPT_MAX_LENGTH) + "…";
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
excerpt = "";
|
||||||
|
}
|
||||||
|
|
||||||
holder.excerptView.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineFontSize);
|
holder.excerptView.setTextSize(TypedValue.COMPLEX_UNIT_SP, headlineFontSize);
|
||||||
holder.excerptView.setText(excerpt);
|
holder.excerptView.setText(excerpt);
|
||||||
|
Loading…
Reference in New Issue
Block a user