You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by an...@apache.org on 2019/12/24 16:50:16 UTC

[syncope] branch 2_1_X updated: enduser, please do not check against default values if there isn't any

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

andreapatricelli 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 778eda5  enduser, please do not check against default values if there isn't any
778eda5 is described below

commit 778eda5c981f3c0ae1c35fc75b806673a254c433
Author: Andrea Patricelli <an...@apache.org>
AuthorDate: Tue Dec 24 17:50:02 2019 +0100

    enduser, please do not check against default values if there isn't any
---
 .../main/java/org/apache/syncope/client/enduser/util/Validation.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/util/Validation.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/util/Validation.java
index 4924a53..1f50646 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/util/Validation.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/util/Validation.java
@@ -85,7 +85,7 @@ public final class Validation {
     }
 
     private static boolean isValid(final AttrTO attrTO, final CustomAttribute customAttribute) {
-        return customAttribute.isReadonly()
+        return customAttribute.isReadonly() && !customAttribute.getDefaultValues().isEmpty()
                 ? attrTO.getValues().stream().allMatch(value -> customAttribute.getDefaultValues().contains(value))
                 : true;
     }