From 181f32d80a9fb7887e93666b2f1ef10d62622789 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Sun, 14 Apr 2019 16:18:20 -0400 Subject: Bugfix: Entering an empty string into To no longer crashes. --- src/org/unitConverter/converterGUI/UnitConverterGUI.java | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit v1.2.3