Prevent crash

This commit is contained in:
M66B 2019-10-16 16:57:43 +02:00
parent e4632f3ba9
commit e9521e20a1
2 changed files with 4 additions and 0 deletions

View File

@ -276,6 +276,8 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
db.beginTransaction(); db.beginTransaction();
EntityMessage message = db.message().getMessage(mid); EntityMessage message = db.message().getMessage(mid);
if (message == null)
continue;
if (rule.matches(context, message, null)) if (rule.matches(context, message, null))
if (rule.execute(context, message)) if (rule.execute(context, message))

View File

@ -1160,6 +1160,8 @@ public class FragmentRule extends FragmentBase {
db.message().getMessageIdsByFolder(rule.folder, null, null, null); db.message().getMessageIdsByFolder(rule.folder, null, null, null);
for (long id : ids) { for (long id : ids) {
EntityMessage message = db.message().getMessage(id); EntityMessage message = db.message().getMessage(id);
if (message == null)
continue;
if (rule.matches(context, message, null)) if (rule.matches(context, message, null))
matching.add(message); matching.add(message);