From d718e8bddcf4a5644cf82fca87ac5eb9da6041a0 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Mon, 26 Sep 2011 17:18:37 +0100 Subject: [PATCH] Fixed error when no parameter given to f balance. --- .../factions/commands/FCommandBalance.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/com/massivecraft/factions/commands/FCommandBalance.java b/src/com/massivecraft/factions/commands/FCommandBalance.java index 15a6e999..7a77d009 100644 --- a/src/com/massivecraft/factions/commands/FCommandBalance.java +++ b/src/com/massivecraft/factions/commands/FCommandBalance.java @@ -1,5 +1,7 @@ package com.massivecraft.factions.commands; +import org.bukkit.entity.Player; + import com.massivecraft.factions.Conf; import com.massivecraft.factions.Econ; import com.massivecraft.factions.Faction; @@ -25,10 +27,15 @@ public class FCommandBalance extends FBaseCommand { return; } - String factionName = parameters.get(0); - Faction faction = findFaction(factionName, true); + Faction faction; - sendMessage(Conf.colorChrome+faction.getTag()+"'s balance: "+ Econ.moneyString(faction.getMoney())); + if (parameters.size() > 0) { + faction = findFaction(parameters.get(0), true); + } else { + faction = me.getFaction(); + } + + sendMessage(Conf.colorChrome+faction.getTag()+" balance: "+ Econ.moneyString(faction.getMoney())); } }