From ce7468e63ade5d307ddc6ed00348d134d48bde37 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 20 Jun 2016 00:52:05 +1000 Subject: [PATCH] Fix economy NPE --- .../com/intellectualcrafters/plot/commands/MainCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java index 644498624..15949419e 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java @@ -3,6 +3,7 @@ package com.intellectualcrafters.plot.commands; import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.ConsolePlayer; +import com.intellectualcrafters.plot.object.Expression; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotArea; @@ -158,8 +159,9 @@ public class MainCommand extends Command { if (EconHandler.manager != null) { PlotArea area = player.getApplicablePlotArea(); if (area != null) { - Double price = area.PRICES.get(cmd.getFullId()).evalute(0d); - if (price != null && EconHandler.manager.getMoney(player) < price) { + Expression priceEval = area.PRICES.get(cmd.getFullId()); + Double price = priceEval != null ? priceEval.evalute(0d) : 0d; + if (price != 0d && EconHandler.manager.getMoney(player) < price) { if (failure != null) { failure.run(); }