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.
This commit is contained in:
parent
4e5d116713
commit
aae734c175
1 changed files with 10 additions and 13 deletions
|
@ -278,20 +278,17 @@ public class AttachmentProvider extends ContentProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
private File getFile(String dbName, String id) throws FileNotFoundException {
|
private File getFile(String dbName, String id) throws FileNotFoundException {
|
||||||
try {
|
Account account = Preferences.getPreferences(getContext()).getAccount(dbName);
|
||||||
final Account account = Preferences.getPreferences(getContext()).getAccount(dbName);
|
|
||||||
final File attachmentsDir;
|
File attachmentsDir = StorageManager.getInstance(K9.app).getAttachmentDirectory(dbName,
|
||||||
attachmentsDir = StorageManager.getInstance(K9.app).getAttachmentDirectory(dbName,
|
|
||||||
account.getLocalStorageProviderId());
|
account.getLocalStorageProviderId());
|
||||||
final File file = new File(attachmentsDir, id);
|
|
||||||
|
File file = new File(attachmentsDir, id);
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
throw new FileNotFoundException(file.getAbsolutePath());
|
throw new FileNotFoundException(file.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
} catch (IOException e) {
|
|
||||||
Log.w(K9.LOG_TAG, null, e);
|
|
||||||
throw new FileNotFoundException(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Bitmap createThumbnail(String type, InputStream data) {
|
private Bitmap createThumbnail(String type, InputStream data) {
|
||||||
|
|
Loading…
Reference in a new issue