From 1296a831e93e2cb009c23f3b78a8546343655853 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 17 Aug 2023 08:04:50 +0200 Subject: [PATCH] Empty note when not matching Jsoup --- app/src/main/java/eu/faircode/email/EntityRule.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index edbe28b971..049af4bc3e 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -1349,6 +1349,7 @@ public class EntityRule { Log.e(ex); } } + if (html != null) { Document d = JsoupEx.parse(html); String selector = notes.substring(JSOUP_PREFIX.length()); @@ -1362,7 +1363,9 @@ public class EntityRule { } Element e = d.select(selector).first(); - if (e != null) { + if (e == null) + notes = null; + else { notes = e.ownText(); if (!TextUtils.isEmpty(regex)) { Pattern p = Pattern.compile(regex);