mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-15 22:15:15 -05:00
do not throw exception in MessagingController per review comment
This commit is contained in:
parent
7fc8767a5c
commit
32cc97207c
@ -1035,7 +1035,7 @@ public class MessageProvider extends ContentProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (myAccount == null) {
|
if (myAccount == null) {
|
||||||
throw new IllegalArgumentException("Could not find account with id " + accountId);
|
Log.e(K9.LOG_TAG, "Could not find account with id " + accountId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get localstore parameter
|
// get localstore parameter
|
||||||
@ -1048,16 +1048,14 @@ public class MessageProvider extends ContentProvider {
|
|||||||
}
|
}
|
||||||
msg = lf.getMessage(msgUid);
|
msg = lf.getMessage(msgUid);
|
||||||
} catch (MessagingException e) {
|
} catch (MessagingException e) {
|
||||||
throw new RuntimeException(e);
|
Log.e(K9.LOG_TAG, "Unable to retrieve message", e);
|
||||||
}
|
|
||||||
|
|
||||||
if (msg == null) {
|
|
||||||
throw new IllegalArgumentException("Could not find message with id " + msgUid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// launch command to delete the message
|
// launch command to delete the message
|
||||||
MessagingController controller = MessagingController.getInstance(getContext());
|
if ((myAccount != null) && (msg != null)) {
|
||||||
controller.deleteMessages(Collections.singletonList(msg), null);
|
MessagingController controller = MessagingController.getInstance(getContext());
|
||||||
|
controller.deleteMessages(Collections.singletonList(msg), null);
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME return the actual number of deleted messages
|
// FIXME return the actual number of deleted messages
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user