mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Merge pull request #1 from GiovanH/GiovanH-patch-1
Check player data for corruption
This commit is contained in:
commit
848080b413
@ -297,6 +297,11 @@ public final class CommandUtils {
|
|||||||
for (OfflinePlayer offlinePlayer : mcMMO.p.getServer().getOfflinePlayers()) {
|
for (OfflinePlayer offlinePlayer : mcMMO.p.getServer().getOfflinePlayers()) {
|
||||||
String playerName = offlinePlayer.getName();
|
String playerName = offlinePlayer.getName();
|
||||||
|
|
||||||
|
if (playerName == null) { //Do null checking here to detect corrupted data before sending it throuogh .equals
|
||||||
|
System.err.println("[McMMO] Bad player data file with UIID " + offlinePlayer.getUniqueId() );
|
||||||
|
continue; //Don't let an error here interrupt the loop
|
||||||
|
}
|
||||||
|
|
||||||
if (partialName.equalsIgnoreCase(playerName)) {
|
if (partialName.equalsIgnoreCase(playerName)) {
|
||||||
// Exact match
|
// Exact match
|
||||||
matchedPlayers.clear();
|
matchedPlayers.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user