Check for empty sender on block sender rule

This commit is contained in:
M66B
2020-07-06 11:13:12 +02:00
parent 97bbb52df3
commit 410af9dce0
3 changed files with 11 additions and 4 deletions

View File

@@ -609,9 +609,15 @@ public class EntityRule {
}
static EntityRule blockSender(Context context, EntityMessage message, EntityFolder junk, boolean block_domain, List<String> whitelist) throws JSONException {
if (message.from == null || message.from.length == 0)
return null;
String sender = ((InternetAddress) message.from[0]).getAddress();
String name = MessageHelper.formatAddresses(new Address[]{message.from[0]});
if (TextUtils.isEmpty(sender))
return null;
if (block_domain) {
int at = sender.indexOf('@');
if (at > 0) {