Fix crash when reading empty aw file, fix -SNAPSHOT versions plugin marker not being published

This commit is contained in:
modmuss50
2020-05-14 02:07:34 +01:00
parent bf8dad499d
commit a36d7a20d4
2 changed files with 32 additions and 1 deletions

View File

@@ -47,7 +47,13 @@ public class AccessWidener {
private Set<String> classes = new LinkedHashSet<>();
public void read(BufferedReader reader) throws IOException {
String[] header = reader.readLine().split("\\s+");
String headerStr = reader.readLine();
if (headerStr == null) {
throw new RuntimeException("Cannot read empty or invalid access widener");
}
String[] header = headerStr.split("\\s+");
if (header.length != 3 || !header[0].equals("accessWidener")) {
throw new UnsupportedOperationException("Invalid access access widener header");