0.2h - Resolve PSS NullPointerException through MassiveExceptions.
This commit is contained in:
parent
1037a11149
commit
9a3b472e96
@ -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++)
|
||||
|
@ -48,8 +48,7 @@ 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++)
|
||||
{
|
||||
for (int dz = -radiusZero; dz <= radiusZero; dz++)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user