Fixed an NPE with iConomy handling

This commit is contained in:
Drakia
2011-05-05 22:21:51 -07:00
parent 9a296c282e
commit 4c6c829348
3 changed files with 8 additions and 3 deletions

View File

@ -313,7 +313,9 @@ public class Stargate extends JavaPlugin {
boolean iConCharge = (iConomyHandler.useiConomy() && !portal.isFree() && !hasPerm(player, "stargate.free.use", player.isOp()));
String target = (portal.getGate().getToOwner() ? portal.getOwner() : null);
iConCharge = iConCharge && !target.equals(player.getName());
if (target != null)
iConCharge = iConCharge && !target.equals(player.getName());
if (!iConCharge || iConomyHandler.chargePlayer(player.getName(), target, portal.getGate().getUseCost())) {
if (iConCharge && portal.getGate().getUseCost() > 0) {
player.sendMessage(ChatColor.GREEN + "Deducted " + iConomyHandler.format(portal.getGate().getUseCost()));
@ -372,7 +374,8 @@ public class Stargate extends JavaPlugin {
boolean iConCharge = (iConomyHandler.useiConomy() && !portal.isFree() && !hasPerm(player, "stargate.free.use", player.isOp()));
String target = (portal.getGate().getToOwner() ? portal.getOwner() : null);
iConCharge = iConCharge && !target.equals(player.getName());
if (target != null)
iConCharge = iConCharge && !target.equals(player.getName());
if (!iConCharge || iConomyHandler.chargePlayer(player.getName(), target, portal.getGate().getUseCost())) {
if (iConCharge && portal.getGate().getUseCost() > 0) {

View File

@ -1,6 +1,6 @@
name: Stargate
main: net.TheDgtl.Stargate.Stargate
version: 0.4.5
version: 0.4.6
description: Stargate mod for Bukkit
author: Drakia
website: http://www.thedgtl.net