diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-18 11:57:28 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-18 11:57:28 +0200 |
commit | 1e5f916b2a61b90c610614178bcd4c971817c83d (patch) | |
tree | f80061b8dfe12cb89ca4774e66df15818d03ddb8 /src/eu/siacs/conversations/persistance/FileBackend.java | |
parent | 8cc72b5a56569803296bf8970a06a4706fadd0e1 (diff) |
tried to avoid some more race conditions in jingle
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/persistance/FileBackend.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/persistance/FileBackend.java b/src/eu/siacs/conversations/persistance/FileBackend.java index f7f986f2..7433946b 100644 --- a/src/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/eu/siacs/conversations/persistance/FileBackend.java @@ -100,11 +100,14 @@ public class FileBackend { .decodeFile(getJingleFile(message).getAbsolutePath()); } - public Bitmap getThumbnailFromMessage(Message message, int size) { + public Bitmap getThumbnailFromMessage(Message message, int size) throws FileNotFoundException { Bitmap thumbnail = thumbnailCache.get(message.getUuid()); if (thumbnail==null) { Bitmap fullsize = BitmapFactory.decodeFile(getJingleFile(message) .getAbsolutePath()); + if (fullsize==null) { + throw new FileNotFoundException(); + } thumbnail = resize(fullsize, size); this.thumbnailCache.put(message.getUuid(), thumbnail); } |