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"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.fox.ttrss"
|
||||
android:versionCode="375"
|
||||
android:versionName="1.147" >
|
||||
android:versionCode="376"
|
||||
android:versionName="1.148" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="15"
|
||||
|
@ -1045,17 +1045,22 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
} else {
|
||||
String excerpt;
|
||||
|
||||
if (m_activity.getApiLevel() >= 11) {
|
||||
excerpt = article.excerpt != null ? article.excerpt : "";
|
||||
excerpt = excerpt.replace("…", "…");
|
||||
excerpt = excerpt.replace("]]>", "");
|
||||
excerpt = Jsoup.parse(excerpt).text();
|
||||
} else {
|
||||
excerpt = article.articleDoc.text();
|
||||
try {
|
||||
if (m_activity.getApiLevel() >= 11) {
|
||||
excerpt = article.excerpt != null ? article.excerpt : "";
|
||||
excerpt = excerpt.replace("…", "…");
|
||||
excerpt = excerpt.replace("]]>", "");
|
||||
excerpt = Jsoup.parse(excerpt).text();
|
||||
} else {
|
||||
excerpt = article.articleDoc.text();
|
||||
|
||||
if (excerpt.length() > CommonActivity.EXCERPT_MAX_LENGTH)
|
||||
excerpt = excerpt.substring(0, CommonActivity.EXCERPT_MAX_LENGTH) + "…";
|
||||
}
|
||||
if (excerpt.length() > 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.setText(excerpt);
|
||||
|
Loading…
Reference in New Issue
Block a user