Skip to content

Commit

Permalink
potential NPE fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vehovsky committed Apr 12, 2020
1 parent 1dbaf8b commit 4684ee4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/me/tongfei/progressbar/TerminalUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ synchronized public static boolean cursorMovementSupport() {

synchronized static void closeTerminal() {
try {
terminal.close();
terminal = null;
if (terminal != null) {
terminal.close();
terminal = null;
}
} catch (IOException ignored) { /* noop */ }
}

Expand Down

0 comments on commit 4684ee4

Please sign in to comment.