Skip to content

Commit

Permalink
fixed Webhook filters method to allow empty lists and strings
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed May 30, 2024
1 parent 84cd3b2 commit d44df86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions para-core/src/main/java/com/erudika/para/core/Webhook.java
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,11 @@ private static boolean matchesPropFilter(Webhook webhook, ParaObject paraObject)
String propValue = StringUtils.substringAfter(webhook.getPropertyFilter(), ":");
Set<String> vals = new LinkedHashSet<>(List.of(StringUtils.split(propValue, ",|", 50)));
boolean matchAll = StringUtils.contains(propValue, ",");
// boolean multiple = StringUtils.containsAny(propValue, ",", "|");
Map<String, Object> props = ParaObjectUtils.getAnnotatedFields(paraObject, null, false);
if (props.containsKey(propName)) {
Object v = props.get(propName);
if ("-".equals(propValue) && (v == null || StringUtils.isBlank(v.toString()))) {
if ("-".equals(propValue) && (v == null || StringUtils.isBlank(v.toString()) ||
(v instanceof Collection && ((Collection) v).isEmpty()))) {
return true;
}
if (v instanceof Collection) {
Expand Down

0 comments on commit d44df86

Please sign in to comment.