From cb815445e14b760f7c6d10ff776603044619b425 Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 3 Jun 2019 21:40:18 -0400 Subject: [PATCH] If empty integer make it 0 --- .../epicvouchers/libraries/inventory/icons/IntegerIcon.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/IntegerIcon.java b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/IntegerIcon.java index b8bb2a0..839033f 100644 --- a/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/IntegerIcon.java +++ b/src/main/java/com/songoda/epicvouchers/libraries/inventory/icons/IntegerIcon.java @@ -9,6 +9,6 @@ import java.util.function.BiConsumer; public class IntegerIcon extends StringIcon { public IntegerIcon(EpicVouchers instance, String string, int current, BiConsumer consumer) { - super(instance, Material.IRON_INGOT, string, "" + current, (player, edited) -> consumer.accept(player, Integer.parseInt(edited)), StringUtils::isNumeric); + super(instance, Material.IRON_INGOT, string, String.valueOf(current), (player, edited) -> consumer.accept(player, edited.equals("") ? 0 : Integer.parseInt(edited)), StringUtils::isNumeric); } }