From a0557112a1a4b05af40070ffc8730b9c9cfe0e78 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Wed, 21 Jul 2021 15:55:26 +0200 Subject: [PATCH] Handle db command args sanely --- .../main/java/com/plotsquared/core/command/DatabaseCommand.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Core/src/main/java/com/plotsquared/core/command/DatabaseCommand.java b/Core/src/main/java/com/plotsquared/core/command/DatabaseCommand.java index 908e02fe6..2554e2e87 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DatabaseCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/DatabaseCommand.java @@ -215,6 +215,7 @@ public class DatabaseCommand extends SubCommand { if (args.length < 6) { player.sendMessage(StaticCaption.of( "/plot database mysql [host] [port] [username] [password] [database] {prefix}")); + return false; } String host = args[1]; String port = args[2]; @@ -229,6 +230,7 @@ public class DatabaseCommand extends SubCommand { case "sqlite" -> { if (args.length < 2) { player.sendMessage(StaticCaption.of("/plot database sqlite [file]")); + return false; } File sqliteFile = FileUtils.getFile(PlotSquared.platform().getDirectory(), args[1] + ".db");