diff --git a/launcher/src/main/java/com/skcraft/launcher/util/EnvironmentParser.java b/launcher/src/main/java/com/skcraft/launcher/util/EnvironmentParser.java index 159ec63..2afcd3a 100644 --- a/launcher/src/main/java/com/skcraft/launcher/util/EnvironmentParser.java +++ b/launcher/src/main/java/com/skcraft/launcher/util/EnvironmentParser.java @@ -85,23 +85,28 @@ public class EnvironmentParser { private String parseValue() throws IOException { StringBuilder buffer = new StringBuilder(); - while (true) { - char c = read(); + try { + while (true) { + char c = read(); - switch (c) { - case '\r': - case '\n': - return buffer.toString(); - case '"': - buffer.append(parseQuotedPhrase()); - break; - case '\\': - char next = read(); - buffer.append(next); - break; - default: - buffer.append(c); + switch (c) { + case '\r': + case '\n': + return buffer.toString(); + case '"': + buffer.append(parseQuotedPhrase()); + break; + case '\\': + char next = read(); + buffer.append(next); + break; + default: + buffer.append(c); + } } + } catch (EOFException e) { + // No terminating newline. bad! + return buffer.toString(); } }