diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-05-12 14:59:46 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-05-12 14:59:46 +0200 |
commit | 3455d10a4a87916bfe5da52ca9c401dafa8d5155 (patch) | |
tree | e7b6cc4520ad0dd64e348d2e9a27ffe7a81db696 /src/eu/siacs/conversations/persistance | |
parent | 4d0bf7971ec321a55f180b833b033ceaa6635fdf (diff) |
Better error handling if attach file doesnt work (on permission denied)
and unified encrypted and unencrypted file attachment
Diffstat (limited to 'src/eu/siacs/conversations/persistance')
-rw-r--r-- | src/eu/siacs/conversations/persistance/FileBackend.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/eu/siacs/conversations/persistance/FileBackend.java b/src/eu/siacs/conversations/persistance/FileBackend.java index 868e23985..becb1ee3b 100644 --- a/src/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/eu/siacs/conversations/persistance/FileBackend.java @@ -102,7 +102,7 @@ public class FileBackend { boolean success = scalledBitmap.compress( Bitmap.CompressFormat.WEBP, 75, os); if (!success) { - // Log.d("xmppService", "couldnt compress"); + return null; } os.flush(); os.close(); @@ -112,14 +112,12 @@ public class FileBackend { message.setBody(""+size+","+width+","+height); return file; } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + return null; } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + return null; + } catch (SecurityException e) { + return null; } - - return null; } public Bitmap getImageFromMessage(Message message) { |