mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-03 05:51:22 +01: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
@ -43,13 +43,15 @@ public class Commandclearinventory extends EssentialsCommand {
|
||||
throws Exception {
|
||||
Collection<Player> players = new ArrayList<Player>();
|
||||
User senderUser = ess.getUser(sender.getPlayer());
|
||||
// Clear previous command execution before potential errors to reset confirmation.
|
||||
String previousClearCommand = senderUser.getConfirmingClearCommand();
|
||||
senderUser.setConfirmingClearCommand(null);
|
||||
String previousClearCommand = "";
|
||||
|
||||
int offset = 0;
|
||||
|
||||
if (sender.isPlayer()) {
|
||||
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("*")) {
|
||||
|
Loading…
Reference in New Issue
Block a user