Skip to content

Commit 597860c

Browse files
committed
Handle null values for player names
1 parent 1a9b606 commit 597860c

File tree

1 file changed

+6
-1
lines changed
  • AdvancedCore/src/com/bencodez/advancedcore/api/user/userstorage/mysql

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,12 @@ public ConcurrentHashMap<UUID, String> getRowsUUIDNameQuery() {
367367
String uuid = rs.getString("uuid");
368368
String playerName = rs.getString("PlayerName");
369369
if (uuid != null && !uuid.isEmpty() && !uuid.equals("null")) {
370-
uuidNames.put(UUID.fromString(uuid), playerName);
370+
try {
371+
uuidNames.put(UUID.fromString(uuid), playerName);
372+
} catch (NullPointerException e) {
373+
plugin.debug(e);
374+
// failsafe
375+
}
371376
}
372377
}
373378
sql.close();

0 commit comments

Comments
 (0)