1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 17:57:16 +00:00

Fixed potential crash

This commit is contained in:
M66B 2018-09-30 15:23:17 +00:00
parent f93e4ca813
commit 6786358082

View file

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