From aae734c175b630db9654ec221b1210f772a02397 Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 24 Jan 2012 22:14:21 +0100 Subject: [PATCH] Don't Log.w() full stacktrace if file wasn't found This happens regularly when AttachmentView tries to get a thumbnail for attachments that haven't been downloaded yet. --- .../fsck/k9/provider/AttachmentProvider.java | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/com/fsck/k9/provider/AttachmentProvider.java b/src/com/fsck/k9/provider/AttachmentProvider.java index dd380e6af..ec81e30ba 100644 --- a/src/com/fsck/k9/provider/AttachmentProvider.java +++ b/src/com/fsck/k9/provider/AttachmentProvider.java @@ -278,20 +278,17 @@ public class AttachmentProvider extends ContentProvider { } private File getFile(String dbName, String id) throws FileNotFoundException { - try { - final Account account = Preferences.getPreferences(getContext()).getAccount(dbName); - final File attachmentsDir; - attachmentsDir = StorageManager.getInstance(K9.app).getAttachmentDirectory(dbName, - account.getLocalStorageProviderId()); - final File file = new File(attachmentsDir, id); - if (!file.exists()) { - throw new FileNotFoundException(file.getAbsolutePath()); - } - return file; - } catch (IOException e) { - Log.w(K9.LOG_TAG, null, e); - throw new FileNotFoundException(e.getMessage()); + Account account = Preferences.getPreferences(getContext()).getAccount(dbName); + + File attachmentsDir = StorageManager.getInstance(K9.app).getAttachmentDirectory(dbName, + account.getLocalStorageProviderId()); + + File file = new File(attachmentsDir, id); + if (!file.exists()) { + throw new FileNotFoundException(file.getAbsolutePath()); } + + return file; } private Bitmap createThumbnail(String type, InputStream data) {