diff --git a/src/main/java/net/Broken/Tools/UserManager/Stats/UserStatsUtils.java b/src/main/java/net/Broken/Tools/UserManager/Stats/UserStatsUtils.java index c3883c0..3f8698c 100644 --- a/src/main/java/net/Broken/Tools/UserManager/Stats/UserStatsUtils.java +++ b/src/main/java/net/Broken/Tools/UserManager/Stats/UserStatsUtils.java @@ -60,6 +60,10 @@ public class UserStatsUtils { public List getUserStats(UserEntity userEntity){ User jdaUser = MainBot.jda.getUserById(userEntity.getJdaId()); + //TODO clean database for deleted users + + if(jdaUser == null) + return null; logger.debug(userEntity); logger.debug(userEntity.getUserStats()); if(userEntity.getUserStats() == null || userEntity.getUserStats().size() == 0 || userEntity.getUserStats().size() < jdaUser.getMutualGuilds().size()){