diff --git a/src/main/java/dev/array21/skinfixer/commands/subcommands/GetCommand.java b/src/main/java/dev/array21/skinfixer/commands/subcommands/GetCommand.java index 1e7ab52..256d50b 100644 --- a/src/main/java/dev/array21/skinfixer/commands/subcommands/GetCommand.java +++ b/src/main/java/dev/array21/skinfixer/commands/subcommands/GetCommand.java @@ -28,7 +28,8 @@ public void onSubcommand(SkinFixer plugin, CommandSender sender, String[] args) if(args[0].contains("https://") || args[0].contains("http://")) { int indexOfQuery = args[0].indexOf('?'); - String url = args[0].substring(0, indexOfQuery > 0 ? indexOfQuery : args[0].length()); + int endIndex = indexOfQuery > 0 ? indexOfQuery : args[0].length(); + String url = args[0].substring(0, endIndex); int code = new AddNewSkin(plugin).addByUrl(url); sender.sendMessage(ChatColor.GOLD + LangHandler.model.getCodeSkinAdded.replaceAll("%CODE%", ChatColor.RED + String.valueOf(code) + ChatColor.GOLD));