Skip to content
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

NPE if WORDNET_HOME environment variable is not set #15

Open
nileger opened this issue Jan 23, 2022 · 0 comments
Open

NPE if WORDNET_HOME environment variable is not set #15

nileger opened this issue Jan 23, 2022 · 0 comments
Assignees

Comments

@nileger
Copy link
Member

nileger commented Jan 23, 2022

Problem

In WordNetWrapper.initline 72 we check for the WORDNET_HOME environment variable: !System.getenv("WORDNET_HOME").isEmpty() && !System.getenv("WORDNET_HOME").isBlank().

However, if no environment variable is set, System.getenv("WORDNET_HOME") returns null. Consequently, !System.getenv("WORDNET_HOME").isEmpty() throws a NPE.

Solution

StringUtils.isNotEmpty(System.getenv("WORDNET_HOME"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants