From 2a2ccd535ece8529b4c93922261d8ecbfe421b9e Mon Sep 17 00:00:00 2001 From: SHsuperCM Date: Sat, 5 Feb 2022 14:14:43 +0200 Subject: Fixed property without separator passing null key --- .../fabric/citresewn/pack/format/PropertiesGroupAdapter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertiesGroupAdapter.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertiesGroupAdapter.java index bfa4091..fb694ae 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertiesGroupAdapter.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertiesGroupAdapter.java @@ -20,7 +20,7 @@ public class PropertiesGroupAdapter extends PropertyGroup { } @Override - public PropertyGroup load(String packName, Identifier identifier, InputStream is) throws IOException, InvalidIdentifierException { + public PropertyGroup load(String packName, Identifier identifier, InputStream is) throws IOException { try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) { String line; int linePos = 0, multilineSkip = 0; @@ -93,6 +93,9 @@ public class PropertiesGroupAdapter extends PropertyGroup { builder.append(c); } + if (key == null) + throw new IOException("Missing separator in line " + linePos); + int pos = linePos - multilineSkip; multilineSkip = 0; this.put(pos, packName, identifier, key, keyMetadata, "=", builder.toString()); -- cgit