summaryrefslogtreecommitdiff
path: root/src/org/unitConverter
diff options
context:
space:
mode:
authorAdrien Hopkins <adrien.p.hopkins@gmail.com>2019-04-14 16:18:20 -0400
committerAdrien Hopkins <adrien.p.hopkins@gmail.com>2019-04-14 16:18:20 -0400
commit181f32d80a9fb7887e93666b2f1ef10d62622789 (patch)
tree925232566904f27807d7abe3e918b47c251d8e07 /src/org/unitConverter
parent0c1ccf1c444e6d458f2be11d0cf6461fee15cd11 (diff)
Bugfix: Entering an empty string into To no longer crashes.
Diffstat (limited to 'src/org/unitConverter')
-rwxr-xr-xsrc/org/unitConverter/converterGUI/UnitConverterGUI.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/org/unitConverter/converterGUI/UnitConverterGUI.java b/src/org/unitConverter/converterGUI/UnitConverterGUI.java
index aecb64f..1f59e3a 100755
--- a/src/org/unitConverter/converterGUI/UnitConverterGUI.java
+++ b/src/org/unitConverter/converterGUI/UnitConverterGUI.java
@@ -216,6 +216,10 @@ final class UnitConverterGUI {
this.view.showErrorDialog("Parse Error", "Please enter a unit expression in the From: box.");
return;
}
+ if (toUnitString.isEmpty()) {
+ this.view.showErrorDialog("Parse Error", "Please enter a unit expression in the To: box.");
+ return;
+ }
// try to parse from
final Unit from;