You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2023/02/27 07:39:15 UTC

[syncope] branch 2_1_X updated: Avoiding NPE when requesting to add fields from a null object

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/2_1_X by this push:
     new 070fd25021 Avoiding NPE when requesting to add fields from a null object
070fd25021 is described below

commit 070fd250217596006d04905495f20884fb6946a1
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Mon Feb 27 08:38:37 2023 +0100

    Avoiding NPE when requesting to add fields from a null object
---
 .../java/org/apache/syncope/core/provisioning/api/jexl/JexlUtils.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/jexl/JexlUtils.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/jexl/JexlUtils.java
index ac96817ed1..3e5067f104 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/jexl/JexlUtils.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/jexl/JexlUtils.java
@@ -124,6 +124,10 @@ public final class JexlUtils {
     }
 
     public static void addFieldsToContext(final Object object, final JexlContext jexlContext) {
+        if (object == null) {
+            return;
+        }
+
         Set<Pair<PropertyDescriptor, Field>> cached = FIELD_CACHE.get(object.getClass());
         if (cached == null) {
             FIELD_CACHE.put(object.getClass(), Collections.synchronizedSet(new HashSet<>()));