Fix issue with loading usernames on MongoDB - closes #257

This commit is contained in:
Luck 2017-04-21 16:58:07 +01:00
parent 3d54f832c5
commit c64f72e394
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 2 additions and 7 deletions

View File

@ -325,7 +325,7 @@ public class MongoDBBacking extends AbstractBacking {
boolean save = plugin.getUserManager().giveDefaultIfNeeded(user, false); boolean save = plugin.getUserManager().giveDefaultIfNeeded(user, false);
if (user.setName(name, false)) { if (user.setName(d.getString("name"), false)) {
save = true; save = true;
} }

View File

@ -343,13 +343,8 @@ public class SQLBacking extends AbstractBacking {
} }
user.getPrimaryGroup().setStoredValue(pg); user.getPrimaryGroup().setStoredValue(pg);
String name = userName.get();
if (name == null) {
name = "null";
}
// Update their username to what was in the storage if the one in the local instance is null // Update their username to what was in the storage if the one in the local instance is null
user.setName(name, false); user.setName(userName.get(), false);
// If the user has any data in storage // If the user has any data in storage
if (!data.isEmpty()) { if (!data.isEmpty()) {