fixed a bug which causes a NullPointerException if in a test case a signal is named which does not exist in the circuit.

This commit is contained in:
hneemann 2016-11-10 13:53:03 +01:00
parent 0d59b974c0
commit d36d90061f

View File

@ -120,18 +120,18 @@ public class TestResultDialog extends JDialog {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
JLabel comp = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); JLabel comp = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
Value v = (Value) value; Value v = (Value) value;
if (v != null) {
comp.setText(v.toString());
comp.setHorizontalAlignment(JLabel.CENTER);
comp.setText(v.toString()); if (v instanceof MatchedValue) {
comp.setHorizontalAlignment(JLabel.CENTER); if (((MatchedValue) v).isPassed())
comp.setBackground(PASSED_COLOR);
if (v instanceof MatchedValue) { else
if (((MatchedValue) v).isPassed()) comp.setBackground(FAILED_COLOR);
comp.setBackground(PASSED_COLOR); } else
else comp.setBackground(Color.WHITE);
comp.setBackground(FAILED_COLOR); }
} else
comp.setBackground(Color.WHITE);
return comp; return comp;
} }
} }