Skip to content

Commit af9800c

Browse files
authored
Merge pull request #2319 from ControlSystemStudio/CSSTUDIO-1706
CSSTUDIO-1706: Empty widget field (precision) causes warning message
2 parents 6d7eca8 + 9967347 commit af9800c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

app/display/model/src/main/java/org/csstudio/display/builder/model/properties/IntegerWidgetProperty.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,16 @@ public IntegerWidgetProperty(
6363
@Override
6464
protected Integer parseExpandedSpecification(final String text) throws Exception
6565
{
66+
67+
if(text.isBlank())
68+
{ // If the value read from the .bob is empty then it should return the default
69+
// note we should hard-fail here; there shouldn't be a null value by this point,
70+
// and Integer.valueOf(null) throws an NPE instead of NumberFormatException.
71+
return default_value;
72+
}
73+
6674
try
67-
{ // Should be integer..
75+
{ // Otherwise try to parse to an integer
6876
return Integer.valueOf(text);
6977
}
7078
catch (final NumberFormatException ex)

0 commit comments

Comments
 (0)