Skip to content

Commit

Permalink
LineReaderImpl: clear commandsBuffer only in case of Exception, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Nov 6, 2019
1 parent 92c598b commit 2fb9845
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,8 @@ public String readLine(String prompt, String rightPrompt, MaskingCallback maskin
} catch (SyntaxError e) {
done = true;
} catch (Exception e) {
throw new IllegalArgumentException(e.getMessage());
} finally {
commandsBuffer.clear();
throw new IllegalArgumentException(e.getMessage());
}
} while (!done);
AttributedStringBuilder sb = new AttributedStringBuilder();
Expand Down

0 comments on commit 2fb9845

Please # to comment.