Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
CommandFlectonechat: fix NumberFormatException and other exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFaser committed Nov 13, 2023
1 parent 796b1ca commit 5ab25c8
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,16 @@ public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command
} else object = string;
}

if (StringUtils.isNumeric(args[3])) {
object = Integer.parseInt(args[3]);
} else if (NumberUtils.isNumber(args[3])) {
object = Double.parseDouble(args[3]);
} else if (args[3].equalsIgnoreCase("true") || args[3].equalsIgnoreCase("false")) {
object = Boolean.parseBoolean(args[3]);
try {
if (StringUtils.isNumeric(args[3])) {
object = Integer.parseInt(args[3]);
} else if (NumberUtils.isNumber(args[3])) {
object = Double.parseDouble(args[3]);
} else if (args[3].equalsIgnoreCase("true") || args[3].equalsIgnoreCase("false")) {
object = Boolean.parseBoolean(args[3]);
}
} catch (Exception e) {
object = args[3];
}

FConfiguration file = fileType.get().getFile();
Expand Down

0 comments on commit 5ab25c8

Please sign in to comment.