diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index eed7bdde84..638a860b2b 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -647,15 +647,15 @@ public class EntityRule { @Override public EvaluationValue evaluate( Expression expression, Token functionToken, EvaluationValue... parameterValues) { + List result = new ArrayList<>(); String name = parameterValues[0].getStringValue(); - - List result = new ArrayList<>(); - if (headers != null) + if (name != null && headers != null) { for (Header header : headers) if (name.equalsIgnoreCase(header.getName())) result.add(header.getValue()); - Log.i("EXPR " + name + "=" + TextUtils.join(", ", result)); + Log.i("EXPR " + name + "=" + TextUtils.join(", ", result)); + } return new EvaluationValue(result, ExpressionConfiguration.defaultConfiguration()); }