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<GuildStats> ranked = new ArrayList<>();
|
||||
for(UserStats stats : allStats){
|
||||
if(stats != null){
|
||||
String avatar = MainBot.jda.getUserById(stats.getUser().getJdaId()).getEffectiveAvatarUrl();
|
||||
GuildStats temp = new GuildStats(stats.getUser().getName(), 0, avatar, stats.getVocalTime(), stats.getMessageCount(), stats.getApiCommandCount());
|
||||
if(stats.getUser().getId().equals(userEntity.getId())){
|
||||
selfGuildStats = temp;
|
||||
}
|
||||
ranked.add(temp);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
ranked.sort((guildStats, t1) -> (int) (t1.total - guildStats.total));
|
||||
|
Loading…
Reference in New Issue
Block a user