From 558f775b2b1f8824c1cee3c71db03835e499a9a0 Mon Sep 17 00:00:00 2001 From: Zrips Date: Thu, 11 Aug 2016 17:06:25 +0300 Subject: [PATCH] Check for null player --- com/gamingmesh/jobs/container/JobsPlayer.java | 9 ++++++--- com/gamingmesh/jobs/dao/JobsDAO.java | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/com/gamingmesh/jobs/container/JobsPlayer.java b/com/gamingmesh/jobs/container/JobsPlayer.java index 49e92b32..1fad901c 100644 --- a/com/gamingmesh/jobs/container/JobsPlayer.java +++ b/com/gamingmesh/jobs/container/JobsPlayer.java @@ -128,7 +128,7 @@ public class JobsPlayer { * @return the Multiplier */ public double getVipSpawnerMultiplier() { - if (!this.OffPlayer.isOnline()) + if (OffPlayer == null || !this.OffPlayer.isOnline()) return 1.0; if (VipSpawnerMultiplier < 0) updateVipSpawnerMultiplier(); @@ -152,11 +152,14 @@ public class JobsPlayer { public double getBoost(String JobName, BoostType type, boolean force) { + double Boost = 1.0; + + if (this.OffPlayer == null) + return Boost; + if (this.player == null) this.player = Bukkit.getPlayer(this.OffPlayer.getUniqueId()); - double Boost = 1.0; - if (this.player == null) return Boost; diff --git a/com/gamingmesh/jobs/dao/JobsDAO.java b/com/gamingmesh/jobs/dao/JobsDAO.java index 03046d4d..a91ae341 100644 --- a/com/gamingmesh/jobs/dao/JobsDAO.java +++ b/com/gamingmesh/jobs/dao/JobsDAO.java @@ -23,7 +23,6 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.UUID;