Fix #22765: IAE when sending a null license

Signed-off-by: Taylor Smock <tsmock@meta.com>
pull/22/head v786
Taylor Smock 2023-02-23 12:15:27 -07:00
rodzic f1f69dacac
commit 1ce9aa9e1c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 233BB2E466604E27
1 zmienionych plików z 1 dodań i 14 usunięć

Wyświetl plik

@ -187,19 +187,6 @@ public class MapWithAIProvidersPanel extends JPanel {
@SuppressWarnings("unchecked")
public final Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
// See #22740
if (value == null) {
final StringBuilder message = new StringBuilder();
for (int tableRow = 0; tableRow < table.getRowCount(); tableRow++) {
message.append('|');
for (int tableCol = 0; tableCol < table.getColumnCount(); tableCol++) {
final Object tableVal = table.getValueAt(tableRow, tableCol);
message.append(tableVal).append('|');
}
message.append(System.lineSeparator());
}
throw new IllegalArgumentException("value was null:" + System.lineSeparator() + message);
}
T obj = (T) value;
JLabel label = (JLabel) super.getTableCellRendererComponent(table, mapper.apply(obj), isSelected, hasFocus,
row, column);
@ -208,7 +195,7 @@ public class MapWithAIProvidersPanel extends JPanel {
GuiHelper.setBackgroundReadable(label, defaultColor);
GuiHelper.setBackgroundReadable(label, isSelected ? selectedColor : defaultColor);
if (this.highlightIfActive) {
if (this.highlightIfActive && obj != null) {
MapWithAIInfo info = obj instanceof MapWithAIInfo ? (MapWithAIInfo) obj : reverseMapper.apply(obj);
if (info == null) {
GuiHelper.setBackgroundReadable(label, defaultColor);