kopia lustrzana https://github.com/JOSM/MapWithAI
Fix #22765: IAE when sending a null license
Signed-off-by: Taylor Smock <tsmock@meta.com>pull/22/head v786
rodzic
f1f69dacac
commit
1ce9aa9e1c
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue