diff options
author | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2019-04-14 16:18:20 -0400 |
---|---|---|
committer | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2019-04-14 16:18:20 -0400 |
commit | 181f32d80a9fb7887e93666b2f1ef10d62622789 (patch) | |
tree | 925232566904f27807d7abe3e918b47c251d8e07 /src/org/unitConverter | |
parent | 0c1ccf1c444e6d458f2be11d0cf6461fee15cd11 (diff) |
Bugfix: Entering an empty string into To no longer crashes.
Diffstat (limited to 'src/org/unitConverter')
-rwxr-xr-x | src/org/unitConverter/converterGUI/UnitConverterGUI.java | 4 |
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; |