Skip to content

Commit

Permalink
Avoid potential call with a null parameter to User.getInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Apr 16, 2022
1 parent 10d8352 commit 5c2f2ec
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ else if (args.size() < 2)
else if (!args.get(1).isEmpty())
{
UUID targetUUID = this.getPlayers().getUUID(args.get(0));
User target = User.getInstance(targetUUID);

if (targetUUID == null || target == null)
if (targetUUID == null)
{
if (user.isPlayer())
{
Expand All @@ -95,7 +94,8 @@ else if (!args.get(1).isEmpty())

return false;
}


User target = User.getInstance(targetUUID);
// Add world name back at the start

if (args.get(1).equals("all"))
Expand Down

0 comments on commit 5c2f2ec

Please sign in to comment.