mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-13 04:17:32 +00:00
Fix username lookup returning "null" instead of null (#3220)
This commit is contained in:
2 files changed
+8
-2
No files matched your search
+4
-1
@@ -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;
|
||||
}
|
||||
|
||||
+4
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user