Skip to content

Commit

Permalink
Fixed a null error on shop load
Browse files Browse the repository at this point in the history
+ Fixed a null error on shop load
  • Loading branch information
noahbclarkson committed Jan 6, 2021
1 parent b1a6dc3 commit 1527d4f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,14 @@ public static String loadPriceDisplay(String item) {
double currentPrice = getItemPrice(item, false);
float timePeriod = (float) Config.getTimePeriod();
float timePeriodsInADay = (float) (1 / (timePeriod / 1440));
List<Double> newMap = Main.getItemPrices().get(item).prices;
List<Double> newMap;
try{
newMap = Main.getItemPrices().get(item).prices;
}
catch(NullPointerException ex){
return (ChatColor.WHITE + Config.getCurrencySymbol() + df2.format(currentPrice) + ChatColor.DARK_GRAY
+ " - " + ChatColor.GRAY + "%0.0");
}
if (newMap.size() <= timePeriodsInADay) {
return (ChatColor.WHITE + Config.getCurrencySymbol() + df2.format(currentPrice) + ChatColor.DARK_GRAY
+ " - " + ChatColor.GRAY + "%0.0");
Expand Down

0 comments on commit 1527d4f

Please sign in to comment.