fixing bug 1945 (empty (null) color not allowed in competitor edit dialog); empty field means null

This commit is contained in:
Axel Uhl committed 2014-05-07 21:34:58 +02:00
1 parent 16b57cdaf0
commit ad4ce750c8
1 file changed
+8 -4
@@ -132,10 +132,14 @@ public class CompetitorEditDialog extends DataEntryDialog<CompetitorDTO> {
@Override
protected CompetitorDTO getResult() {
Color color;
try {
color = new RGBColor(displayColorTextBox.getText());
} catch (IllegalArgumentException iae) {
color = new InvalidColor(iae);
if (displayColorTextBox.getText() == null || displayColorTextBox.getText().isEmpty()) {
color = null;
} else {
try {
color = new RGBColor(displayColorTextBox.getText());
} catch (IllegalArgumentException iae) {
color = new InvalidColor(iae);
}
}
CompetitorDTO result = new CompetitorDTOImpl(name.getText(), color,
/* twoLetterIsoCountryCode */ null,