0.2h - Resolve PSS NullPointerException through MassiveExceptions.

This commit is contained in:
ulumulu1510 2016-02-26 16:57:09 +01:00 committed by Olof Larsson
parent 1037a11149
commit 9a3b472e96
3 changed files with 3 additions and 9 deletions

View File

@ -48,8 +48,6 @@ public class CmdFactionsSetCircle extends CmdFactionsSetXRadius
chunks.add(chunk); // The center should come first for pretty messages
Integer radiusZero = this.getRadiusZero();
if (radiusZero == null) return null;
double radiusSquared = radiusZero * radiusZero;
for (int dx = -radiusZero; dx <= radiusZero; dx++)

View File

@ -48,7 +48,6 @@ public class CmdFactionsSetSquare extends CmdFactionsSetXRadius
chunks.add(chunk); // The center should come first for pretty messages
Integer radiusZero = this.getRadiusZero();
if (radiusZero == null) return null;
for (int dx = -radiusZero; dx <= radiusZero; dx++)
{

View File

@ -37,15 +37,13 @@ public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX
// Radius Claim Min
if (radius < 1)
{
msg("<b>If you specify a radius, it must be at least 1.");
return null;
throw new MassiveException().setMsg("<b>If you specify a radius, it must be at least 1.");
}
// Radius Claim Max
if (radius > MConf.get().setRadiusMax && ! msender.isOverriding())
{
msg("<b>The maximum radius allowed is <h>%s<b>.", MConf.get().setRadiusMax);
return null;
throw new MassiveException().setMsg("<b>The maximum radius allowed is <h>%s<b>.", MConf.get().setRadiusMax);
}
return radius;
@ -54,7 +52,6 @@ public abstract class CmdFactionsSetXRadius extends CmdFactionsSetX
public Integer getRadiusZero() throws MassiveException
{
Integer ret = this.getRadius();
if (ret == null) return ret;
return ret - 1;
}