Skip to content

Commit

Permalink
Bug fixed: java.lang.StringIndexOutOfBoundsException when parsing a…
Browse files Browse the repository at this point in the history
…n empty `MultiComponent`.
  • Loading branch information
ATATC committed Aug 13, 2023
1 parent 311f0a0 commit 0d1c20f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@ComponentConfig(tagName = "mc")
public class MultiComponent extends Component implements Collection<Component> {
public static @NotNull Parser<MultiComponent> PARSER = expr -> {
if (expr.isEmpty()) return new MultiComponent();
char open = expr.charAt(0);
Text.IndexPair indexes = Text.matchBrackets(expr, open, Text.pairBracket(open));
int endIndex = indexes.end();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/atatctech/hephaestus/component/Ref.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class Ref extends Component {
static {
PARSER = Ref::new;
}

protected @Nullable Component to;

public Ref(@Nullable String id) {
Expand Down

0 comments on commit 0d1c20f

Please sign in to comment.