From 31de7de38503fa1250d89de7ba5e913590576489 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Mon, 1 Mar 2021 16:21:12 +0100 Subject: [PATCH] Cover a couple of NPEs --- Core/src/main/java/com/plotsquared/core/command/Chat.java | 3 +++ .../main/java/com/plotsquared/core/command/DebugRoadRegen.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Core/src/main/java/com/plotsquared/core/command/Chat.java b/Core/src/main/java/com/plotsquared/core/command/Chat.java index 01d27d440..c267d77d2 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Chat.java +++ b/Core/src/main/java/com/plotsquared/core/command/Chat.java @@ -27,6 +27,7 @@ package com.plotsquared.core.command; import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.player.PlotPlayer; +import com.plotsquared.core.plot.PlotArea; @CommandDeclaration(command = "chat", usage = "/plot chat", @@ -37,6 +38,8 @@ public class Chat extends SubCommand { @Override public boolean onCommand(PlotPlayer player, String[] args) { + PlotArea area = player.getPlotAreaAbs(); + check(area, TranslatableCaption.of("errors.not_in_plot_world")); if (player.getPlotAreaAbs().isForcingPlotChat()) { player.sendMessage(TranslatableCaption.of("chat.plot_chat_forced")); return true; diff --git a/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java b/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java index 2211c8446..7e7798817 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java +++ b/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java @@ -68,6 +68,8 @@ public class DebugRoadRegen extends SubCommand { return false; } + PlotArea area = player.getPlotAreaAbs(); + check(area, TranslatableCaption.of("errors.not_in_plot_world")); if (plot.getVolume() > Integer.MAX_VALUE) { player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large")); return false;