fix(gui): handle null value in TableCellRenderer (#1642)

This commit is contained in:
Skylot
2022-08-16 20:41:14 +01:00
parent e0aedc7949
commit cf7767e702
2 changed files with 4 additions and 0 deletions
@@ -420,6 +420,9 @@ public abstract class CommonSearchDialog extends JFrame {
@Override
public Component getTableCellRendererComponent(JTable table, Object obj,
boolean isSelected, boolean hasFocus, int row, int column) {
if (obj == null || table == null) {
return emptyLabel;
}
Component comp = makeCell((JNode) obj, column);
updateSelection(table, comp, column, isSelected);
return comp;
@@ -553,6 +553,7 @@ public class SearchDialog extends CommonSearchDialog {
}
private void addSearchResult(JNode node) {
Objects.requireNonNull(node);
synchronized (pendingResults) {
UiUtils.notUiThreadGuard();
pendingResults.add(node);