Skip to content

Commit

Permalink
Fix NullPointerException, when console process dies while reading inp…
Browse files Browse the repository at this point in the history
…ut from it
  • Loading branch information
stirante committed Feb 25, 2021
1 parent 6844e8b commit 36d59ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/stirante/lolclient/SimpleConsole.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public SimpleConsole(String executable) {
@Override
public void run() {
while (running.get()) {
while (running.get() && cmdOutput.hasNextLine()) {
while (running.get() && process.isAlive() && cmdOutput.hasNextLine()) {
String s = cmdOutput.nextLine();
LISTENERS_LOCK.lock();
listeners.removeIf(stringBooleanFunction -> stringBooleanFunction.apply(s));
Expand Down

0 comments on commit 36d59ed

Please sign in to comment.