mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-10 22:01:00 +01:00
Fixed NPE on API#getPlayerInspectPageLink #456
This commit is contained in:
parent
8d3afc9286
commit
7f8f67845a
@ -82,8 +82,10 @@ public class API {
|
||||
* @return {@code ../player/PlayerName}
|
||||
*/
|
||||
public String getPlayerInspectPageLink(String name) {
|
||||
String link = "../player/" + name.replace(" ", "%20").replace(".", "%2E");
|
||||
return link;
|
||||
if (name == null) {
|
||||
return "#";
|
||||
}
|
||||
return "../player/" + name.replace(" ", "%20").replace(".", "%2E");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -116,9 +116,7 @@ public class Analysis {
|
||||
profile.addActiveSessions(new HashMap<>(SessionCache.getActiveSessions()));
|
||||
serverProfile = profile;
|
||||
|
||||
for (PlayerProfile player : profile.getPlayers()) {
|
||||
dataCache.updateNames(player.getUuid(), player.getName(), null);
|
||||
}
|
||||
updatePlayerNameCache(profile, dataCache);
|
||||
|
||||
long fetchPhaseLength = Benchmark.stop("Analysis", "Fetch Phase");
|
||||
setBannedByPlugins(profile);
|
||||
@ -150,6 +148,12 @@ public class Analysis {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void updatePlayerNameCache(ServerProfile profile, DataCache dataCache) {
|
||||
for (PlayerProfile player : profile.getPlayers()) {
|
||||
dataCache.updateNames(player.getUuid(), player.getName(), null);
|
||||
}
|
||||
}
|
||||
|
||||
private void setBannedByPlugins(ServerProfile profile) {
|
||||
UUID serverUUID = Plan.getServerUUID();
|
||||
List<BanData> banPlugins = plugin.getHookHandler().getAdditionalDataSources().stream()
|
||||
|
Loading…
Reference in New Issue
Block a user