Skip to content

Commit

Permalink
actually check for nulls before reading from arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurumi78 committed Sep 24, 2024
1 parent 5941375 commit 6932b26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class AlterCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if(commandSender instanceof Player) {
if(args[0] != null) {
if(args.length >= 1) {
if (args[0].equalsIgnoreCase("create")) {
createAlterCommand(args, (Player) commandSender);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class SystemCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if(commandSender instanceof Player) {
if (args[0] != null) {
if (args.length >= 1) {
switch (args[0].toLowerCase()) {
case "create":
createSystemCommand((Player) commandSender);
Expand Down

0 comments on commit 6932b26

Please sign in to comment.