mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-19 06:58:17 +00:00
Issue was a NullPointerException due to senderUser not being null-checked. I opted to place the couple of lines of code into the sender.isPlayer() check as opposed to null-checking.
This commit is contained in:
parent
fd6717d06d
commit
50e2d27d5b
1 changed files with 5 additions and 3 deletions
|
@ -43,13 +43,15 @@ public class Commandclearinventory extends EssentialsCommand {
|
||||||
throws Exception {
|
throws Exception {
|
||||||
Collection<Player> players = new ArrayList<Player>();
|
Collection<Player> players = new ArrayList<Player>();
|
||||||
User senderUser = ess.getUser(sender.getPlayer());
|
User senderUser = ess.getUser(sender.getPlayer());
|
||||||
// Clear previous command execution before potential errors to reset confirmation.
|
String previousClearCommand = "";
|
||||||
String previousClearCommand = senderUser.getConfirmingClearCommand();
|
|
||||||
senderUser.setConfirmingClearCommand(null);
|
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
if (sender.isPlayer()) {
|
if (sender.isPlayer()) {
|
||||||
players.add(sender.getPlayer());
|
players.add(sender.getPlayer());
|
||||||
|
// Clear previous command execution before potential errors to reset confirmation.
|
||||||
|
previousClearCommand = senderUser.getConfirmingClearCommand();
|
||||||
|
senderUser.setConfirmingClearCommand(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allowAll && args.length > 0 && args[0].contentEquals("*")) {
|
if (allowAll && args.length > 0 && args[0].contentEquals("*")) {
|
||||||
|
|
Loading…
Reference in a new issue