mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-11 23:00:59 +00:00
fixing bug 1945 (empty (null) color not allowed in competitor edit dialog); empty field means null
This commit is contained in:
1 parent
16b57cdaf0
commit
ad4ce750c8
1 file changed
+8
-4
+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,
|
||||
|
||||
Reference in new issue
Block a user