From 89d6e78551be27edb6858f6ab12e1bd73a9314f5 Mon Sep 17 00:00:00 2001 From: Zrips Date: Thu, 11 May 2017 11:13:51 +0300 Subject: [PATCH] Trying to avoid issues with missing limit data --- com/gamingmesh/jobs/container/JobsPlayer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/com/gamingmesh/jobs/container/JobsPlayer.java b/com/gamingmesh/jobs/container/JobsPlayer.java index 45dbe915..38e0166c 100644 --- a/com/gamingmesh/jobs/container/JobsPlayer.java +++ b/com/gamingmesh/jobs/container/JobsPlayer.java @@ -92,6 +92,8 @@ public class JobsPlayer { if (paymentLimits == null) { paymentLimits = Jobs.getJobsDAO().getPlayersLimits(this); } + if (paymentLimits == null) + paymentLimits = new PaymentData(); return paymentLimits; } @@ -105,8 +107,8 @@ public class JobsPlayer { if (!limit.isEnabled()) return true; PaymentData data = getPaymentLimit(); - - if (data.IsReachedLimit(type, this.limits.get(type))) { + Integer value = this.limits.get(type); + if (data.IsReachedLimit(type, value == null ? 0 : value)) { if (player.isOnline() && !data.isInformed() && !data.isReseted()) { player.sendMessage(Jobs.getLanguage().getMessage("command.limit.output.reached" + type.getName().toLowerCase() + "limit")); player.sendMessage(Jobs.getLanguage().getMessage("command.limit.output.reached" + type.getName().toLowerCase() + "limit2"));