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

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


The following commit(s) were added to refs/heads/3_0_X by this push:
     new f0b1bebf90 [SYNCOPE-1828] check on null value (#857)
f0b1bebf90 is described below

commit f0b1bebf90bc96578fb0fa97e53b9558075bdf3f
Author: Samuel Garofalo <[email protected]>
AuthorDate: Fri Oct 4 12:26:37 2024 +0200

    [SYNCOPE-1828] check on null value (#857)
---
 .../console/authprofiles/AuthProfileDirectoryPanel.java     | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/client/am/console/src/main/java/org/apache/syncope/client/console/authprofiles/AuthProfileDirectoryPanel.java
 
b/client/am/console/src/main/java/org/apache/syncope/client/console/authprofiles/AuthProfileDirectoryPanel.java
index 93992c6240..dcd59952d8 100644
--- 
a/client/am/console/src/main/java/org/apache/syncope/client/console/authprofiles/AuthProfileDirectoryPanel.java
+++ 
b/client/am/console/src/main/java/org/apache/syncope/client/console/authprofiles/AuthProfileDirectoryPanel.java
@@ -24,6 +24,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.syncope.client.console.SyncopeConsoleSession;
 import 
org.apache.syncope.client.console.authprofiles.AuthProfileDirectoryPanel.AuthProfileProvider;
 import org.apache.syncope.client.console.commons.AMConstants;
@@ -128,7 +129,7 @@ public class AuthProfileDirectoryPanel
 
             @Override
             protected boolean isCondition(final IModel<AuthProfileTO> 
rowModel) {
-                return 
!rowModel.getObject().getImpersonationAccounts().isEmpty();
+                return 
CollectionUtils.isNotEmpty(rowModel.getObject().getImpersonationAccounts());
             }
         });
         columns.add(new BooleanConditionColumn<>(new 
StringResourceModel("googleMfaAuthTokens")) {
@@ -137,7 +138,7 @@ public class AuthProfileDirectoryPanel
 
             @Override
             protected boolean isCondition(final IModel<AuthProfileTO> 
rowModel) {
-                return 
!rowModel.getObject().getGoogleMfaAuthTokens().isEmpty();
+                return 
CollectionUtils.isNotEmpty(rowModel.getObject().getGoogleMfaAuthTokens());
             }
         });
         columns.add(new BooleanConditionColumn<>(new 
StringResourceModel("googleMfaAuthAccounts")) {
@@ -146,7 +147,7 @@ public class AuthProfileDirectoryPanel
 
             @Override
             protected boolean isCondition(final IModel<AuthProfileTO> 
rowModel) {
-                return 
!rowModel.getObject().getGoogleMfaAuthAccounts().isEmpty();
+                return 
CollectionUtils.isNotEmpty(rowModel.getObject().getGoogleMfaAuthAccounts());
             }
         });
         columns.add(new BooleanConditionColumn<>(new 
StringResourceModel("u2fRegisteredDevices")) {
@@ -155,7 +156,7 @@ public class AuthProfileDirectoryPanel
 
             @Override
             protected boolean isCondition(final IModel<AuthProfileTO> 
rowModel) {
-                return 
!rowModel.getObject().getU2FRegisteredDevices().isEmpty();
+                return 
CollectionUtils.isNotEmpty(rowModel.getObject().getU2FRegisteredDevices());
             }
         });
         columns.add(new BooleanConditionColumn<>(new 
StringResourceModel("mfaTrustedDevices")) {
@@ -164,7 +165,7 @@ public class AuthProfileDirectoryPanel
 
             @Override
             protected boolean isCondition(final IModel<AuthProfileTO> 
rowModel) {
-                return !rowModel.getObject().getMfaTrustedDevices().isEmpty();
+                return 
CollectionUtils.isNotEmpty(rowModel.getObject().getMfaTrustedDevices());
             }
         });
         columns.add(new BooleanConditionColumn<>(new 
StringResourceModel("webAuthnAccount")) {
@@ -173,7 +174,7 @@ public class AuthProfileDirectoryPanel
 
             @Override
             protected boolean isCondition(final IModel<AuthProfileTO> 
rowModel) {
-                return 
!rowModel.getObject().getWebAuthnDeviceCredentials().isEmpty();
+                return 
CollectionUtils.isNotEmpty(rowModel.getObject().getWebAuthnDeviceCredentials());
             }
         });
 

Reply via email to