Skip to content

Commit

Permalink
Fix #22765: IAE when sending a null license
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Feb 23, 2023
1 parent f1f69da commit 1ce9aa9
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,6 @@ private static class MapWithAITableCellRenderer<T> extends DefaultTableCellRende
@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);
Expand All @@ -208,7 +195,7 @@ public final Component getTableCellRendererComponent(JTable table, Object value,
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);
Expand Down

0 comments on commit 1ce9aa9

Please sign in to comment.