Skip to content

Commit

Permalink
[SYNCOPE-1828] check on null value (#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelGaro authored Oct 4, 2024
1 parent 4f04cbe commit f0b1beb
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -128,7 +129,7 @@ protected List<IColumn<AuthProfileTO, String>> getColumns() {

@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")) {
Expand All @@ -137,7 +138,7 @@ protected boolean isCondition(final IModel<AuthProfileTO> rowModel) {

@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")) {
Expand All @@ -146,7 +147,7 @@ protected boolean isCondition(final IModel<AuthProfileTO> rowModel) {

@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")) {
Expand All @@ -155,7 +156,7 @@ protected boolean isCondition(final IModel<AuthProfileTO> rowModel) {

@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")) {
Expand All @@ -164,7 +165,7 @@ protected boolean isCondition(final IModel<AuthProfileTO> rowModel) {

@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")) {
Expand All @@ -173,7 +174,7 @@ protected boolean isCondition(final IModel<AuthProfileTO> rowModel) {

@Override
protected boolean isCondition(final IModel<AuthProfileTO> rowModel) {
return !rowModel.getObject().getWebAuthnDeviceCredentials().isEmpty();
return CollectionUtils.isNotEmpty(rowModel.getObject().getWebAuthnDeviceCredentials());
}
});

Expand Down

0 comments on commit f0b1beb

Please sign in to comment.