Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
burningtnt committed Aug 11, 2023
1 parent 82a6a0c commit 7e45fe8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@

import java.util.List;
import java.util.function.Function;
import java.util.logging.Level;

import static org.jackhuang.hmcl.util.Logging.LOG;

public class TwoLineListItem extends VBox {
private static final String DEFAULT_STYLE_CLASS = "two-line-list-item";
Expand Down Expand Up @@ -241,7 +244,11 @@ private static ChangeListener<Boolean> generateTranslateListener(TranslateTransi
}

private void reLayout() {
this.layout();
try {
this.layout();
} catch (NullPointerException npe) {
LOG.log(Level.WARNING, "For some unknown reasons, invoking this::layout too fast may produce NullPointerException.", npe);
}

double titleMaxWidth = tags.size() == 0 ? this.getWidth() : this.getWidth() * TITLE_PART;
double titleWidth = Math.min(titleLabel.getWidth() / 2, titleMaxWidth);
Expand Down

0 comments on commit 7e45fe8

Please sign in to comment.