aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/ConversationFragment.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-18 11:57:28 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-18 11:57:28 +0200
commit1e5f916b2a61b90c610614178bcd4c971817c83d (patch)
treef80061b8dfe12cb89ca4774e66df15818d03ddb8 /src/eu/siacs/conversations/ui/ConversationFragment.java
parent8cc72b5a56569803296bf8970a06a4706fadd0e1 (diff)
tried to avoid some more race conditions in jingle
Diffstat (limited to 'src/eu/siacs/conversations/ui/ConversationFragment.java')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index f43f37a36..6e1db2bf7 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -1,5 +1,6 @@
package eu.siacs.conversations.ui;
+import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
@@ -277,9 +278,16 @@ public class ConversationFragment extends Fragment {
viewHolder.messageBody.setTextColor(0xff33B5E5);
viewHolder.messageBody.setTypeface(null,Typeface.ITALIC);
} else {
- viewHolder.image.setImageBitmap(activity.xmppConnectionService.getFileBackend().getThumbnailFromMessage(item,(int) (metrics.density * 288)));
- viewHolder.messageBody.setVisibility(View.GONE);
- viewHolder.image.setVisibility(View.VISIBLE);
+ try {
+ Bitmap thumbnail = activity.xmppConnectionService.getFileBackend().getThumbnailFromMessage(item,(int) (metrics.density * 288));
+ viewHolder.image.setImageBitmap(thumbnail);
+ viewHolder.messageBody.setVisibility(View.GONE);
+ viewHolder.image.setVisibility(View.VISIBLE);
+ } catch (FileNotFoundException e) {
+ viewHolder.image.setVisibility(View.GONE);
+ viewHolder.messageBody.setText("error loading image file");
+ viewHolder.messageBody.setVisibility(View.VISIBLE);
+ }
}
} else {
viewHolder.image.setVisibility(View.GONE);