diff --git a/src/com/massivecraft/factions/commands/FCommandSafeclaim.java b/src/com/massivecraft/factions/commands/FCommandSafeclaim.java index db949e5c..7ca8d110 100644 --- a/src/com/massivecraft/factions/commands/FCommandSafeclaim.java +++ b/src/com/massivecraft/factions/commands/FCommandSafeclaim.java @@ -36,7 +36,15 @@ public class FCommandSafeclaim extends FBaseCommand { // Was a radius set? if (parameters.size() > 0) { - int radius = Integer.parseInt(parameters.get(0)); + int radius; + try { + radius = Integer.parseInt(parameters.get(0)); + } + catch(NumberFormatException ex) { + sendMessage("Usage: " + getUseageTemplate(false)); + sendMessage("The radius value must be an integer."); + return; + } FLocation from = playerFlocation.getRelative(radius, radius); FLocation to = playerFlocation.getRelative(-radius, -radius); diff --git a/src/com/massivecraft/factions/commands/FCommandWarclaim.java b/src/com/massivecraft/factions/commands/FCommandWarclaim.java index 9b036689..2643430a 100644 --- a/src/com/massivecraft/factions/commands/FCommandWarclaim.java +++ b/src/com/massivecraft/factions/commands/FCommandWarclaim.java @@ -35,7 +35,15 @@ public class FCommandWarclaim extends FBaseCommand { // Was a radius set? if (parameters.size() > 0) { - int radius = Integer.parseInt(parameters.get(0)); + int radius; + try { + radius = Integer.parseInt(parameters.get(0)); + } + catch(NumberFormatException ex) { + sendMessage("Usage: " + getUseageTemplate(false)); + sendMessage("The radius value must be an integer."); + return; + } FLocation from = playerFlocation.getRelative(radius, radius); FLocation to = playerFlocation.getRelative(-radius, -radius);