better error handling

This commit is contained in:
rusefillc 2021-11-18 19:33:20 -05:00
parent 224090dfec
commit 1a7eecbf01
2 changed files with 2 additions and 0 deletions

Binary file not shown.

View File

@ -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);