Skip to content

Check null to avoid null pointer exception #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bact
Copy link
Collaborator

@bact bact commented May 21, 2025

Check if the string input is null in getFirstLicenseToken and isSingleTokenString

To fix #333

Check if the string input is null in `getFirstLicenseToken` and `isSingleTokenString`

Signed-off-by: Arthit Suriyawongkul <[email protected]>
@bact bact added the bug Something isn't working label May 21, 2025
Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

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

Since we're now using a Java version that support the @Nullable annotations, we should add these to the calls.

Do we want to open a separate PR to fix the empty optional strings returning true when it should be false?

bact and others added 2 commits May 24, 2025 20:18
@bact
Copy link
Collaborator Author

bact commented May 24, 2025

Do we want to open a separate PR to fix the empty optional strings returning true when it should be false?

We can fix it here as well.
I also have to update the unit test to expect false when the string is empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE on matching templates with no text in optional rule
2 participants