From 19a1d7fab45a00ff0a0e6b97775027d8b2959383 Mon Sep 17 00:00:00 2001 From: ulumulu1510 Date: Thu, 6 Apr 2017 22:32:52 +0200 Subject: [PATCH] Fix NPE when not overriding. --- .../factions/cmd/CmdFactionsFlagList.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java index 68a668e5..f2066265 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlagList.java @@ -1,16 +1,18 @@ package com.massivecraft.factions.cmd; +import java.util.List; + +import org.bukkit.Bukkit; + import com.massivecraft.factions.Factions; import com.massivecraft.factions.entity.MFlag; import com.massivecraft.factions.entity.MFlagColl; +import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.command.Parameter; import com.massivecraft.massivecore.pager.Pager; import com.massivecraft.massivecore.pager.Stringifier; import com.massivecraft.massivecore.predicate.Predicate; -import org.bukkit.Bukkit; - -import java.util.List; public class CmdFactionsFlagList extends FactionsCommand { @@ -33,9 +35,10 @@ public class CmdFactionsFlagList extends FactionsCommand { // Parameter final int page = this.readArg(); + final MPlayer mplayer = msender; // Pager create - String title = "Flag List for " + msenderFaction.describeTo(msender); + String title = "Flag List for " + msenderFaction.describeTo(mplayer); final Pager pager = new Pager<>(this, title, page, new Stringifier() { @Override @@ -51,7 +54,7 @@ public class CmdFactionsFlagList extends FactionsCommand public void run() { // Get items - List items = MFlagColl.get().getAll(msender.isOverriding() ? null : new Predicate() + List items = MFlagColl.get().getAll(mplayer.isOverriding() ? null : new Predicate() { @Override public boolean apply(MFlag mflag)