mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 00:53:26 +02:00
Handle message file not readable (found)
This commit is contained in:
@@ -746,7 +746,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
protected Spanned onLoad(final Context context, final Bundle args) throws Throwable {
|
||||
TupleMessageEx message = (TupleMessageEx) args.getSerializable("message");
|
||||
if (body == null)
|
||||
body = message.read(context);
|
||||
try {
|
||||
body = message.read(context);
|
||||
} catch (IOException ex) {
|
||||
Log.e(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex));
|
||||
body = ex.toString();
|
||||
DB.getInstance(context).message().setMessageContent(message.id, false, null);
|
||||
}
|
||||
return decodeHtml(message, body);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,13 @@ public class ViewModelBrowse extends ViewModel {
|
||||
boolean match = false;
|
||||
String find = state.search.toLowerCase();
|
||||
EntityMessage message = db.message().getMessage(state.messages.get(i));
|
||||
String body = (message.content ? message.read(state.context) : null);
|
||||
String body = null;
|
||||
if (message.content)
|
||||
try {
|
||||
body = message.read(state.context);
|
||||
} catch (IOException ex) {
|
||||
Log.e(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex));
|
||||
}
|
||||
|
||||
if (message.from != null)
|
||||
for (int j = 0; j < message.from.length && !match; j++)
|
||||
|
||||
Reference in New Issue
Block a user