Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #104: Crash from Tesseract while scrolling a list in Minecolonies #111

Merged
merged 3 commits into from
Feb 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,9 @@ public MutableComponent getText()
return isTextEmpty() ? null : text.get(0);
}

@SuppressWarnings({"unchecked", "rawtypes"})
public void setTextOld(final List<Component> text)
{
setText((List<MutableComponent>)((List) text));
setText(text.stream().map(c -> c instanceof MutableComponent m ? m : c.copy()).toList());
}

public void setText(final List<MutableComponent> text)
Expand All @@ -506,7 +505,7 @@ public void setText(final List<MutableComponent> text)

public void setText(final Component text)
{
setText((MutableComponent) text);
setText(text instanceof MutableComponent m ? m : text.copy());
}

public void setText(final MutableComponent text)
Expand Down