mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-28 20:17:55 +01:00
Fix username lookup returning "null" instead of null (#3220)
This commit is contained in:
parent
272d289d4a
commit
9204848ffb
@ -573,7 +573,10 @@ public class MongoStorage implements StorageImplementation {
|
||||
MongoCollection<Document> c = this.database.getCollection(this.prefix + "uuid");
|
||||
Document doc = c.find(new Document("_id", uniqueId)).first();
|
||||
if (doc != null) {
|
||||
return doc.get("name", String.class);
|
||||
String username = doc.get("name", String.class);
|
||||
if (username != null && !username.equals("null")) {
|
||||
return username;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -694,7 +694,10 @@ public class SqlStorage implements StorageImplementation {
|
||||
ps.setString(1, uniqueId.toString());
|
||||
try (ResultSet rs = ps.executeQuery()) {
|
||||
if (rs.next()) {
|
||||
return rs.getString("username");
|
||||
String username = rs.getString("username");
|
||||
if (username != null && !username.equals("null")) {
|
||||
return username;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user