fix an NPE and other changes

This commit is contained in:
AigleDev
2019-09-15 20:53:27 +02:00
parent 4f38bfa949
commit fb3204ddb1
14 changed files with 70 additions and 69 deletions

View File

@@ -24,8 +24,10 @@ public class CmdPaypalSee extends FCommand {
return;
}
if (context.args.size() == 0) {
if (context.fPlayer.getFaction().getPaypal().isEmpty()) {
if (context.fPlayer.getFaction().getPaypal() == null) {
context.msg(TL.COMMAND_PAYPAL_NOTSET);
} else {
context.msg(TL.PAYPALSEE_PLAYER_PAYPAL, context.fPlayer.getFaction().getPaypal());
@@ -34,7 +36,7 @@ public class CmdPaypalSee extends FCommand {
if (context.fPlayer.isAdminBypassing()) {
Faction faction = context.argAsFaction(0);
if (faction != null) {
if (faction.getPaypal().isEmpty()) {
if (faction.getPaypal() == null) {
context.msg(TL.COMMAND_PAYPALSEE_FACTION_NOTSET, faction.getTag());
} else {
context.msg(TL.COMMAND_PAYPALSEE_FACTION_PAYPAL.toString(), faction.getTag(), faction.getPaypal());
@@ -44,7 +46,7 @@ public class CmdPaypalSee extends FCommand {
context.msg(TL.GENERIC_NOPERMISSION, "see another factions paypal.");
}
} else {
context.msg(FactionsPlugin.getInstance().cmdBase.cmdPaypalSee.getUseageTemplate(context));
context.msg(FactionsPlugin.getInstance().cmdBase.cmdPaypalSee.getUsageTemplate(context));
}
}