Fix NPE
This commit is contained in:
		@@ -74,8 +74,7 @@ public class CmdFactionsSetAll extends CmdFactionsSetXAll
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
				{
 | 
			
		||||
					msg("<b>You must specify which map from console.");
 | 
			
		||||
					return null;
 | 
			
		||||
					throw new MassiveException().addMsg("<b>You must specify which map from console.");
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
 
 | 
			
		||||
@@ -71,8 +71,7 @@ public class CmdFactionsSetAuto extends FactionsCommand
 | 
			
		||||
		if (newFaction == null || newFaction == msender.getAutoClaimFaction())
 | 
			
		||||
		{
 | 
			
		||||
			msender.setAutoClaimFaction(null);
 | 
			
		||||
			msg("<i>Disabled auto-setting as you walk around.");
 | 
			
		||||
			return;
 | 
			
		||||
			throw new MassiveException().addMsg("<i>Disabled auto-setting as you walk around.");
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		// MPerm Preemptive Check
 | 
			
		||||
 
 | 
			
		||||
@@ -4,13 +4,13 @@ import com.massivecraft.factions.Perm;
 | 
			
		||||
import com.massivecraft.factions.entity.BoardColl;
 | 
			
		||||
import com.massivecraft.factions.entity.Faction;
 | 
			
		||||
import com.massivecraft.factions.entity.MConf;
 | 
			
		||||
import com.massivecraft.massivecore.MassiveException;
 | 
			
		||||
import com.massivecraft.massivecore.collections.MassiveSet;
 | 
			
		||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
 | 
			
		||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
 | 
			
		||||
import com.massivecraft.massivecore.ps.PS;
 | 
			
		||||
import com.massivecraft.massivecore.util.MUtil;
 | 
			
		||||
 | 
			
		||||
import java.util.LinkedHashSet;
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -43,7 +43,7 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
	
 | 
			
		||||
	@Override
 | 
			
		||||
	public Set<PS> getChunks()
 | 
			
		||||
	public Set<PS> getChunks() throws MassiveException
 | 
			
		||||
	{
 | 
			
		||||
		// Common Startup
 | 
			
		||||
		final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
 | 
			
		||||
@@ -63,8 +63,7 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple
 | 
			
		||||
		// Limit Reached?
 | 
			
		||||
		if (chunks.size() >= max)
 | 
			
		||||
		{
 | 
			
		||||
			msg("<b>Fill limit of <h>%d <b>reached.", max);
 | 
			
		||||
			return null;
 | 
			
		||||
			throw new MassiveException().addMsg("<b>Fill limit of <h>%d <b>reached.", max);
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		// OK!
 | 
			
		||||
 
 | 
			
		||||
@@ -49,6 +49,7 @@ public abstract class CmdFactionsSetX extends FactionsCommand
 | 
			
		||||
		// Args
 | 
			
		||||
		final Faction newFaction = this.getNewFaction();
 | 
			
		||||
		final Set<PS> chunks = this.getChunks();
 | 
			
		||||
		if (chunks == null) throw new NullPointerException("chunks");
 | 
			
		||||
 | 
			
		||||
		// Apply / Inform
 | 
			
		||||
		msender.tryClaim(newFaction, chunks, this.getFormatOne(), this.getFormatMany());
 | 
			
		||||
 
 | 
			
		||||
@@ -48,8 +48,7 @@ public class CmdFactionsSetpower extends FactionsCommand
 | 
			
		||||
		double maxDifference = 0.1d;
 | 
			
		||||
		if (difference < maxDifference)
 | 
			
		||||
		{
 | 
			
		||||
			msg("%s's <i>power is already <h>%.2f<i>.", mplayer.getDisplayName(msender), newPower);
 | 
			
		||||
			return;
 | 
			
		||||
			throw new MassiveException().addMsg("%s's <i>power is already <h>%.2f<i>.", mplayer.getDisplayName(msender), newPower);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// Event
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user