Skip to content

Commit

Permalink
Fix backport
Browse files Browse the repository at this point in the history
Signed-off-by: Zailer43 <zailer.g2jku@slmails.com>
  • Loading branch information
Zailer43 committed Nov 22, 2024
1 parent f4d042a commit 4469154
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import net.replaceitem.symbolchat.gui.widget.SymbolTabWidget;
import org.jetbrains.annotations.Nullable;

import java.util.Optional;

public class SymbolComponentAdapter extends VanillaWidgetComponent {
protected final SymbolSelectionPanel widget;
@Nullable
Expand All @@ -39,13 +37,11 @@ public SymbolComponentAdapter(SymbolSelectionPanel widget) {
@Nullable
private ClickableWidget findSearchBar() {
try {
Optional<SymbolTabWidget> tabWidgetOptional = this.widget.getCurrentTab();
SymbolTabWidget tabWidgetOptional = this.widget.getCurrentTab();

if (tabWidgetOptional.isPresent()) {
for (var child : tabWidgetOptional.get().children()) {
if (child instanceof SymbolSearchBar symbolSearchBar) {
return symbolSearchBar;
}
for (var child : tabWidgetOptional.children()) {
if (child instanceof SymbolSearchBar symbolSearchBar) {
return symbolSearchBar;
}
}
} catch (NoClassDefFoundError | NoSuchMethodError e) {
Expand Down

0 comments on commit 4469154

Please sign in to comment.