Prevent possible NPE.

This commit is contained in:
elcnesh
2015-02-22 00:23:08 +00:00
parent ab1d24cc8a
commit 2e6452d03f

View File

@@ -36,7 +36,7 @@ public class IntegerRenderer extends ItemCellRenderer {
public final Component getTableCellRendererComponent(final JTable table, Object value0, public final Component getTableCellRendererComponent(final JTable table, Object value0,
final boolean isSelected, final boolean hasFocus, final int row, final int column) { final boolean isSelected, final boolean hasFocus, final int row, final int column) {
if ((int)value0 == -1) { value0 = "-"; } if (value0 == null || (int)value0 == -1) { value0 = "-"; }
return super.getTableCellRendererComponent(table, value0, isSelected, hasFocus, row, column); return super.getTableCellRendererComponent(table, value0, isSelected, hasFocus, row, column);
} }
} }