0.2h - Resolve PSS NullPointerException through MassiveExceptions.
This commit is contained in:
		
				
					committed by
					
						
						Olof Larsson
					
				
			
			
				
	
			
			
			
						parent
						
							1037a11149
						
					
				
				
					commit
					9a3b472e96
				
			@@ -48,8 +48,6 @@ public class CmdFactionsSetCircle extends CmdFactionsSetXRadius
 | 
				
			|||||||
		chunks.add(chunk); // The center should come first for pretty messages
 | 
							chunks.add(chunk); // The center should come first for pretty messages
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		Integer radiusZero = this.getRadiusZero();
 | 
							Integer radiusZero = this.getRadiusZero();
 | 
				
			||||||
		if (radiusZero == null) return null;
 | 
					 | 
				
			||||||
		
 | 
					 | 
				
			||||||
		double radiusSquared = radiusZero * radiusZero;
 | 
							double radiusSquared = radiusZero * radiusZero;
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		for (int dx = -radiusZero; dx <= radiusZero; dx++)
 | 
							for (int dx = -radiusZero; dx <= radiusZero; dx++)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,7 +48,6 @@ public class CmdFactionsSetSquare extends CmdFactionsSetXRadius
 | 
				
			|||||||
		chunks.add(chunk); // The center should come first for pretty messages
 | 
							chunks.add(chunk); // The center should come first for pretty messages
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		Integer radiusZero = this.getRadiusZero();
 | 
							Integer radiusZero = this.getRadiusZero();
 | 
				
			||||||
		if (radiusZero == null) return null;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (int dx = -radiusZero; dx <= radiusZero; dx++)
 | 
							for (int dx = -radiusZero; dx <= radiusZero; dx++)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,15 +37,13 @@ public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX
 | 
				
			|||||||
		// Radius Claim Min
 | 
							// Radius Claim Min
 | 
				
			||||||
		if (radius < 1)
 | 
							if (radius < 1)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			msg("<b>If you specify a radius, it must be at least 1.");
 | 
								throw new MassiveException().setMsg("<b>If you specify a radius, it must be at least 1.");
 | 
				
			||||||
			return null;
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		// Radius Claim Max
 | 
							// Radius Claim Max
 | 
				
			||||||
		if (radius > MConf.get().setRadiusMax && ! msender.isOverriding())
 | 
							if (radius > MConf.get().setRadiusMax && ! msender.isOverriding())
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			msg("<b>The maximum radius allowed is <h>%s<b>.", MConf.get().setRadiusMax);
 | 
								throw new MassiveException().setMsg("<b>The maximum radius allowed is <h>%s<b>.", MConf.get().setRadiusMax);
 | 
				
			||||||
			return null;
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		return radius;
 | 
							return radius;
 | 
				
			||||||
@@ -54,7 +52,6 @@ public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX
 | 
				
			|||||||
	public Integer getRadiusZero() throws MassiveException
 | 
						public Integer getRadiusZero() throws MassiveException
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		Integer ret = this.getRadius();
 | 
							Integer ret = this.getRadius();
 | 
				
			||||||
		if (ret == null) return ret;
 | 
					 | 
				
			||||||
		return ret - 1;
 | 
							return ret - 1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user