Browse Source

Fixed potential crash

main
M66B 6 years ago
parent
commit
6786358082
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      app/src/main/java/eu/faircode/email/FragmentMessages.java

+ 6
- 1
app/src/main/java/eu/faircode/email/FragmentMessages.java View File

@ -182,7 +182,7 @@ public class FragmentMessages extends FragmentEx {
return 0; return 0;
TupleMessageEx message = ((AdapterMessage) rvMessage.getAdapter()).getCurrentList().get(pos); TupleMessageEx message = ((AdapterMessage) rvMessage.getAdapter()).getCurrentList().get(pos);
if (message.threaded || EntityFolder.OUTBOX.equals(message.folderType))
if (message == null || message.threaded || EntityFolder.OUTBOX.equals(message.folderType))
return 0; return 0;
return makeMovementFlags(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT); return makeMovementFlags(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT);
@ -200,6 +200,9 @@ public class FragmentMessages extends FragmentEx {
return; return;
TupleMessageEx message = ((AdapterMessage) rvMessage.getAdapter()).getCurrentList().get(pos); TupleMessageEx message = ((AdapterMessage) rvMessage.getAdapter()).getCurrentList().get(pos);
if (message == null)
return;
boolean inbox = (EntityFolder.ARCHIVE.equals(message.folderType) || EntityFolder.TRASH.equals(message.folderType)); boolean inbox = (EntityFolder.ARCHIVE.equals(message.folderType) || EntityFolder.TRASH.equals(message.folderType));
View itemView = viewHolder.itemView; View itemView = viewHolder.itemView;
@ -237,6 +240,8 @@ public class FragmentMessages extends FragmentEx {
return; return;
TupleMessageEx message = ((AdapterMessage) rvMessage.getAdapter()).getCurrentList().get(pos); TupleMessageEx message = ((AdapterMessage) rvMessage.getAdapter()).getCurrentList().get(pos);
if (message == null)
return;
Log.i(Helper.TAG, "Swiped dir=" + direction + " message=" + message.id); Log.i(Helper.TAG, "Swiped dir=" + direction + " message=" + message.id);
Bundle args = new Bundle(); Bundle args = new Bundle();


Loading…
Cancel
Save