oωo (owo-lib)

oωo (owo-lib)

23M Downloads

`LabelComponent.styleAt` throws `ArrayIndexOutOfBoundsException` if text is empty

kikugie opened this issue · 0 comments

commented
protected Style styleAt(int mouseX, int mouseY) {
    return this.textRenderer.getTextHandler().getStyleAt(this.wrappedText.get(Math.min(mouseY / (this.lineHeight() + this.lineSpacing()), this.wrappedText.size() - 1)), mouseX);
}

If text is empty, this.wrappedText is empty too, which results in index -1