Browse Source

Fixed NPE when showing tree cell popup and no cell is targeted. Fixes #194

pull/198/head
weisj 4 years ago
parent
commit
162a6c6b13
  1. 6
      core/src/main/java/com/github/weisj/darklaf/ui/cell/hint/CellHintPopupListener.java

6
core/src/main/java/com/github/weisj/darklaf/ui/cell/hint/CellHintPopupListener.java

@ -90,6 +90,7 @@ public class CellHintPopupListener<T extends JComponent, I> extends MouseInputAd
final boolean isEditing = cellContainer.isEditingCell(index);
final Rectangle allocation = cellContainer.getAllocation();
final Rectangle cellBounds = cellContainer.getCellBoundsAt(index, isEditing);
if (cellBounds != null && allocation != null) {
final Rectangle visibleBounds = allocation.intersection(cellBounds);
if (visibleBounds.contains(p)) {
final Component comp = cellContainer.getEffectiveCellRendererComponent(index, isEditing);
@ -110,9 +111,10 @@ public class CellHintPopupListener<T extends JComponent, I> extends MouseInputAd
lastIndex = index;
}
}
} else {
lastIndex = null;
return;
}
}
lastIndex = null;
leave();
}

Loading…
Cancel
Save