Still try to correct null pointer
This commit is contained in:
parent
205f6498f2
commit
e3353411bd
@ -194,12 +194,15 @@ public class UserStatsUtils {
|
|||||||
List<UserStats> allStats = userStatsRepository.findByGuildId(guildId);
|
List<UserStats> allStats = userStatsRepository.findByGuildId(guildId);
|
||||||
List<GuildStats> ranked = new ArrayList<>();
|
List<GuildStats> ranked = new ArrayList<>();
|
||||||
for(UserStats stats : allStats){
|
for(UserStats stats : allStats){
|
||||||
String avatar = MainBot.jda.getUserById(stats.getUser().getJdaId()).getEffectiveAvatarUrl();
|
if(stats != null){
|
||||||
GuildStats temp = new GuildStats(stats.getUser().getName(), 0, avatar, stats.getVocalTime(), stats.getMessageCount(), stats.getApiCommandCount());
|
String avatar = MainBot.jda.getUserById(stats.getUser().getJdaId()).getEffectiveAvatarUrl();
|
||||||
if(stats.getUser().getId().equals(userEntity.getId())){
|
GuildStats temp = new GuildStats(stats.getUser().getName(), 0, avatar, stats.getVocalTime(), stats.getMessageCount(), stats.getApiCommandCount());
|
||||||
selfGuildStats = temp;
|
if(stats.getUser().getId().equals(userEntity.getId())){
|
||||||
|
selfGuildStats = temp;
|
||||||
|
}
|
||||||
|
ranked.add(temp);
|
||||||
}
|
}
|
||||||
ranked.add(temp);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ranked.sort((guildStats, t1) -> (int) (t1.total - guildStats.total));
|
ranked.sort((guildStats, t1) -> (int) (t1.total - guildStats.total));
|
||||||
|
Loading…
Reference in New Issue
Block a user