From 2d1e3b8c0356cd2ab1b1f4a6d1fd74e08cc61d23 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Mon, 12 Jul 2021 18:12:54 +0200 Subject: [PATCH] Fixes #3148 --- .../main/java/com/plotsquared/core/command/Visit.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Visit.java b/Core/src/main/java/com/plotsquared/core/command/Visit.java index 3eb22d8a6..c998ba0b8 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Visit.java +++ b/Core/src/main/java/com/plotsquared/core/command/Visit.java @@ -245,7 +245,15 @@ public class Visit extends Command { }); break; } - page = Integer.parseInt(args[1]); + try { + page = Integer.parseInt(args[1]); + } catch (NumberFormatException ignored) { + player.sendMessage( + TranslatableCaption.of("invalid.not_a_number"), + Template.of("value", args[1]) + ); + return CompletableFuture.completedFuture(false); + } // /p v [page] // /p v [page] // /p v [page]