From 21fa52704d1f87cda10f67440ec72bd81d5c7444 Mon Sep 17 00:00:00 2001 From: sgarofalo Date: Fri, 4 Oct 2024 11:44:50 +0200 Subject: [PATCH] [SYNCOPE-1828] check on null value --- .../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.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 @@ protected List> getColumns() { @Override protected boolean isCondition(final IModel rowModel) { - return !rowModel.getObject().getImpersonationAccounts().isEmpty(); + return CollectionUtils.isNotEmpty(rowModel.getObject().getImpersonationAccounts()); } }); columns.add(new BooleanConditionColumn<>(new StringResourceModel("googleMfaAuthTokens")) { @@ -137,7 +138,7 @@ protected boolean isCondition(final IModel rowModel) { @Override protected boolean isCondition(final IModel rowModel) { - return !rowModel.getObject().getGoogleMfaAuthTokens().isEmpty(); + return CollectionUtils.isNotEmpty(rowModel.getObject().getGoogleMfaAuthTokens()); } }); columns.add(new BooleanConditionColumn<>(new StringResourceModel("googleMfaAuthAccounts")) { @@ -146,7 +147,7 @@ protected boolean isCondition(final IModel rowModel) { @Override protected boolean isCondition(final IModel rowModel) { - return !rowModel.getObject().getGoogleMfaAuthAccounts().isEmpty(); + return CollectionUtils.isNotEmpty(rowModel.getObject().getGoogleMfaAuthAccounts()); } }); columns.add(new BooleanConditionColumn<>(new StringResourceModel("u2fRegisteredDevices")) { @@ -155,7 +156,7 @@ protected boolean isCondition(final IModel rowModel) { @Override protected boolean isCondition(final IModel rowModel) { - return !rowModel.getObject().getU2FRegisteredDevices().isEmpty(); + return CollectionUtils.isNotEmpty(rowModel.getObject().getU2FRegisteredDevices()); } }); columns.add(new BooleanConditionColumn<>(new StringResourceModel("mfaTrustedDevices")) { @@ -164,7 +165,7 @@ protected boolean isCondition(final IModel rowModel) { @Override protected boolean isCondition(final IModel rowModel) { - return !rowModel.getObject().getMfaTrustedDevices().isEmpty(); + return CollectionUtils.isNotEmpty(rowModel.getObject().getMfaTrustedDevices()); } }); columns.add(new BooleanConditionColumn<>(new StringResourceModel("webAuthnAccount")) { @@ -173,7 +174,7 @@ protected boolean isCondition(final IModel rowModel) { @Override protected boolean isCondition(final IModel rowModel) { - return !rowModel.getObject().getWebAuthnDeviceCredentials().isEmpty(); + return CollectionUtils.isNotEmpty(rowModel.getObject().getWebAuthnDeviceCredentials()); } });