aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-05-04 23:50:54 +0200
committerChristian Schneppe <christian@pix-art.de>2019-05-04 23:50:54 +0200
commit5b75d52d444d6cda368e85f5884163e229451ece (patch)
treef37f790e0bc298fac5a5f9c458001562a43919db /src/main/java
parent37d8cd61b349680eb6220013171b33589b995457 (diff)
fix crash in RichPreview
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/utils/RichPreview.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/RichPreview.java b/src/main/java/de/pixart/messenger/utils/RichPreview.java
index 10e10b033..5087081ec 100644
--- a/src/main/java/de/pixart/messenger/utils/RichPreview.java
+++ b/src/main/java/de/pixart/messenger/utils/RichPreview.java
@@ -61,7 +61,7 @@ public class RichPreview {
FileInputStream fis = null;
ObjectInputStream is = null;
final File file = new File(context.getCacheDir(), RICH_LINK_METADATA + "/" + filename);
- if(file.exists()) {
+ if (file.exists()) {
Calendar time = Calendar.getInstance();
time.add(Calendar.DAY_OF_YEAR, -7);
Date lastModified = new Date(file.lastModified());
@@ -234,7 +234,7 @@ public class RichPreview {
metaData.setImageurl(resolveURL(url, image));
}
}
- if (metaData.getImageurl().isEmpty()) {
+ if (metaData.getImageurl() != null && metaData.getImageurl().isEmpty()) {
String src = doc.select("link[rel=image_src]").attr("href");
if (!src.isEmpty()) {
metaData.setImageurl(resolveURL(url, src));