Skip to content
Snippets Groups Projects
Commit 2f2b1413 authored by stepan's avatar stepan
Browse files

Fix NPE in ConsoleHandler

parent 7762e930
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,11 @@ public abstract class ConsoleHandler {
public int read() throws IOException {
if (buffer == null) {
pos = 0;
buffer = readLine().getBytes(StandardCharsets.UTF_8);
String line = readLine();
if (line == null) {
return -1;
}
buffer = line.getBytes(StandardCharsets.UTF_8);
}
if (pos == buffer.length) {
buffer = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment