Skip to content

Commit

Permalink
fix npe while loading users with useuuids disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
weaondara committed Nov 3, 2019
1 parent f603b75 commit be81ebe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -164,7 +164,7 @@ public User loadUser(String user)
List<String> groups = getValues(mpe.getData("groups"));
List<TimedValue<String>> timedgroups = getValuesTimed(mpe.getData("timedgroups"));

UUID uuid = BungeePerms.getInstance().getPermissionsManager().getUUIDPlayerDB().getUUID(mpe.getName());
UUID uuid = BungeePerms.getInstance().getConfig().isUseUUIDs() ? BungeePerms.getInstance().getPermissionsManager().getUUIDPlayerDB().getUUID(mpe.getName()) : null;
User u = new User(mpe.getName(), uuid, groups, timedgroups, new ArrayList(), new ArrayList(), new HashMap(), null, null, null);
loadServerWorlds(mpe, u);
u.invalidateCache();
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/net/alpenblock/bungeeperms/io/YAMLBackEnd.java
Expand Up @@ -167,9 +167,12 @@ public User loadUser(String user)
User u = loadUser0(user);
if (u == null)
return null;
UUID uuid = BungeePerms.getInstance().getPermissionsManager().getUUIDPlayerDB().getUUID(user);
if (BungeePerms.getInstance().getConfig().isUseUUIDs())
{
UUID uuid = BungeePerms.getInstance().getPermissionsManager().getUUIDPlayerDB().getUUID(user);
u.setUUID(uuid);
}
u.setName(user);
u.setUUID(uuid);
u.invalidateCache();
return u;
}
Expand Down

0 comments on commit be81ebe

Please sign in to comment.