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 and ilgrosso committed Oct 4, 2024
1 parent b9e6d95 commit 5d1f4cf
Showing 1 changed file with 6 additions and 5 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 @@ -127,7 +128,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 @@ -136,7 +137,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 @@ -145,7 +146,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("mfaTrustedDevices")) {
Expand All @@ -154,7 +155,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 @@ -163,7 +164,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 5d1f4cf

Please sign in to comment.