From e64cdeba8f9b738cdc822a89b04a39508093f6ee Mon Sep 17 00:00:00 2001 From: ExternalTime <84183548+ExternalTime@users.noreply.github.com> Date: Mon, 30 Aug 2021 11:29:46 +0200 Subject: Moved null check before the variable is first used --- .../xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java index ff02c675..30e19c0f 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/PriceInfoTooltip.java @@ -41,14 +41,11 @@ public class PriceInfoTooltip { String name = getInternalNameForItem(stack); try { - if(!list.toString().contains("Avg. BIN Price") && prices.has(name) ){ - if(prices != null){ - - JsonElement getPrice = prices.get(name); - String price = round(getPrice.getAsDouble(), 2); - - list.add(new LiteralText("Avg. BIN Price: ").formatted(Formatting.GOLD).append(new LiteralText(price + " Coins").formatted(Formatting.DARK_AQUA))); - } + if(!list.toString().contains("Avg. BIN Price") && prices != null && prices.has(name) ){ + JsonElement getPrice = prices.get(name); + String price = round(getPrice.getAsDouble(), 2); + + list.add(new LiteralText("Avg. BIN Price: ").formatted(Formatting.GOLD).append(new LiteralText(price + " Coins").formatted(Formatting.DARK_AQUA))); } }catch(Exception e) { MinecraftClient.getInstance().player.sendMessage(new LiteralText(e.toString()), false); -- cgit