Skip to content

Commit 01929dd

Browse files
committed
Better handle invalid player name
1 parent 597860c commit 01929dd

File tree

1 file changed

+3
-7
lines changed
  • AdvancedCore/src/com/bencodez/advancedcore/api/user/userstorage/mysql

1 file changed

+3
-7
lines changed

AdvancedCore/src/com/bencodez/advancedcore/api/user/userstorage/mysql/MySQL.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,9 @@ public ConcurrentHashMap<UUID, String> getRowsUUIDNameQuery() {
366366
while (rs.next()) {
367367
String uuid = rs.getString("uuid");
368368
String playerName = rs.getString("PlayerName");
369-
if (uuid != null && !uuid.isEmpty() && !uuid.equals("null")) {
370-
try {
371-
uuidNames.put(UUID.fromString(uuid), playerName);
372-
} catch (NullPointerException e) {
373-
plugin.debug(e);
374-
// failsafe
375-
}
369+
if (uuid != null && !uuid.isEmpty() && !uuid.equals("null") && playerName != null
370+
&& !playerName.isEmpty()) {
371+
uuidNames.put(UUID.fromString(uuid), playerName);
376372
}
377373
}
378374
sql.close();

0 commit comments

Comments
 (0)