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

TerminalBuilder throws NPE on windows with missing jna/jansi #930

Closed
jvalkeal opened this issue Jan 17, 2024 · 1 comment
Closed

TerminalBuilder throws NPE on windows with missing jna/jansi #930

jvalkeal opened this issue Jan 17, 2024 · 1 comment
Assignees
Milestone

Comments

@jvalkeal
Copy link
Contributor

Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because "this.jna" is null
at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:443) ~[jline-3.24.1.jar!/:na]
at org.jline.terminal.TerminalBuilder.build(TerminalBuilder.java:362) ~[jline-3.24.1.jar!/:na]

There should be null check before throwing IllegalStateException as jna and jansi variables are Booleans.

if (terminal == null && OSUtils.IS_WINDOWS && !jna && !jansi && !jni && (dumb == null || !dumb)) {
throw new IllegalStateException("Unable to create a system terminal. On windows, either "
+ "JNA or JANSI library is required. Make sure to add one of those in the classpath.");
}

@gnodet
Copy link
Member

gnodet commented Jan 19, 2024

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

2 participants