better error handling
This commit is contained in:
parent
7b99df46d0
commit
1268129028
Binary file not shown.
|
@ -275,6 +275,8 @@ public class ConfigField {
|
|||
// Handle just basic division, not a full fledged eval loop
|
||||
scale = scale.substring(1, scale.length() - 1);
|
||||
String[] parts = scale.split("/");
|
||||
if (parts.length != 2)
|
||||
throw new IllegalArgumentException("Two parts of division expected in " + scale);
|
||||
factor = Double.parseDouble(parts[0]) / Double.parseDouble(parts[1]);
|
||||
} else {
|
||||
factor = Double.parseDouble(scale);
|
||||
|
|
Loading…
Reference in New Issue