Prevent NPE

This commit is contained in:
M66B 2023-03-24 07:45:42 +01:00
parent d7d3681ffc
commit de1a622b5d
1 changed files with 4 additions and 4 deletions

View File

@ -2073,8 +2073,8 @@ class Core {
throw new IllegalArgumentException("Not INBOX");
Map<EntityMessage, Message> map = findMessages(context, folder, Arrays.asList(message), istore, ifolder);
if (map.size() == 0)
throw new MessageRemovedException("Message not found");
if (map.get(message) == null)
throw new IllegalArgumentException("Message not found msgid=" + message.msgid);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean download_plain = prefs.getBoolean("download_plain", false);
@ -2114,8 +2114,8 @@ class Core {
return;
Map<EntityMessage, Message> map = findMessages(context, folder, Arrays.asList(message), istore, ifolder);
if (map.size() == 0)
throw new MessageRemovedException("Message not found");
if (map.get(message) == null)
throw new IllegalArgumentException("Message not found msgid=" + message.msgid);
MessageHelper helper = new MessageHelper((MimeMessage) map.entrySet().iterator().next().getValue(), context);
MessageHelper.MessageParts parts = helper.getMessageParts();