9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-29 19:59:11 +00:00

Fix null error on save command

This commit is contained in:
SamB440
2023-04-13 17:44:54 +01:00
parent d531a1ebfa
commit 766fbfc1d4

View File

@@ -217,8 +217,9 @@ public class RPGRegionsCommand {
@CommandDescription("Saves configured regions to the `/plugins/RPGRegions/regions` folder. Also saves user data.")
@CommandPermission("rpgregions.save")
@CommandMethod("rpgregions|rpgr save [async]")
public void onSave(CommandSender sender, @Argument(value = "async", suggestions = "async") String asyncArg) {
boolean async = asyncArg.equals("--async");
public void onSave(CommandSender sender,
@Argument(value = "async", suggestions = "async") @Nullable String asyncArg) {
boolean async = asyncArg != null && asyncArg.equals("--async");
sender.sendMessage(ChatColor.GREEN + "Saving data..." + (async ? ChatColor.GOLD + " (async)" : ""));
long startTime = System.currentTimeMillis();