From 3455d10a4a87916bfe5da52ca9c401dafa8d5155 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 12 May 2014 14:59:46 +0200 Subject: Better error handling if attach file doesnt work (on permission denied) and unified encrypted and unencrypted file attachment --- src/eu/siacs/conversations/persistance/FileBackend.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/eu/siacs/conversations/persistance') diff --git a/src/eu/siacs/conversations/persistance/FileBackend.java b/src/eu/siacs/conversations/persistance/FileBackend.java index 868e2398..becb1ee3 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) { -- cgit v1.2.3