Skip to content

fix(ui): NPE on notEqualsIdentityName password validators#22

Merged
salvatore-coppola merged 2 commits intodevelopfrom
fix/null-pointers-pass-validators
Jan 12, 2026
Merged

fix(ui): NPE on notEqualsIdentityName password validators#22
salvatore-coppola merged 2 commits intodevelopfrom
fix/null-pointers-pass-validators

Conversation

@marcellorinaldo
Copy link
Copy Markdown
Member

This PR fixes some null pointer exceptions that arise when the input has just been created and is null

image

@sonarqubecloud
Copy link
Copy Markdown

Signed-off-by: Marcello Rinaldo Martina <martina.marcello.rinaldo@outlook.com>
Signed-off-by: Marcello Rinaldo Martina <martina.marcello.rinaldo@outlook.com>
public static Validator<String> notEqualsIdentityName(final String identityName, final String message) {
return new ValidatorWrapper<>(new PredicateValidator(v -> !v.equalsIgnoreCase(identityName), message), Priority.MEDIUM);
return new ValidatorWrapper<>(new PredicateValidator(v -> {
if (v == null) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v== null is valid ? It seems strange to me, is it possible to submit a null password ?

Copy link
Copy Markdown
Member Author

@marcellorinaldo marcellorinaldo Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, when the fields is first shown on the UI its value is null. Note that also the other validators are performing a null check

@salvatore-coppola salvatore-coppola merged commit c1542ff into develop Jan 12, 2026
3 checks passed
@salvatore-coppola salvatore-coppola deleted the fix/null-pointers-pass-validators branch January 12, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants