mirror of https://github.com/rusefi/rusefi-1.git
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
|
// Handle just basic division, not a full fledged eval loop
|
||||||
scale = scale.substring(1, scale.length() - 1);
|
scale = scale.substring(1, scale.length() - 1);
|
||||||
String[] parts = scale.split("/");
|
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]);
|
factor = Double.parseDouble(parts[0]) / Double.parseDouble(parts[1]);
|
||||||
} else {
|
} else {
|
||||||
factor = Double.parseDouble(scale);
|
factor = Double.parseDouble(scale);
|
||||||
|
|
Loading…
Reference in New Issue