Prevent NPE if the console is executed via the shell script
@@ -290,7 +290,7 @@ public class ConsoleSessionImpl implements Session {
}
running = false;
- if (thread != Thread.currentThread()) {
+ if (thread != Thread.currentThread() && thread != null) {
thread.interrupt();
}
if (closeCallback != null) {
