mirror of
https://github.com/GTNewHorizons/JustEnoughCalculation.git
synced 2026-11-13 16:54:02 +00:00
Add amount field validation (#15)
This commit is contained in:
1 parent
da39c8e14a
commit
affe3f997f
1 file changed
+5
-1
@@ -271,7 +271,11 @@ public class GuiCraft extends Gui {
|
||||
|
||||
private long getCurrentAmount() {
|
||||
String s = amount.getText();
|
||||
return s.isEmpty() ? 1 : Long.parseLong(amount.getText());
|
||||
try {
|
||||
return s.isEmpty() ? 1 : Long.parseLong(amount.getText());
|
||||
} catch (NumberFormatException ignored) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void addLabel(ILabel l) {
|
||||
|
||||
Reference in new issue
Block a user