Skip to content

Commit

Permalink
Fix NPE on windows with missing jna/jansi (fixes #930) (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jan 23, 2024
1 parent ad35d1a commit 7ad41da
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,11 @@ private Terminal doBuild() throws IOException {
}
}
}
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.");
if (terminal == null && OSUtils.IS_WINDOWS && providers.isEmpty() && (dumb == null || !dumb)) {
throw new IllegalStateException(
"Unable to create a system terminal. On Windows, either JLine's native libraries, JNA "
+ "or Jansi library is required. Make sure to add one of those in the classpath.",
exception);
}
}
if (terminal instanceof AbstractTerminal) {
Expand Down

0 comments on commit 7ad41da

Please sign in to comment.