From 205f6498f2ffe26a1c64b3c38cab3221e68da428 Mon Sep 17 00:00:00 2001 From: Sebastien Date: Tue, 29 Jan 2019 14:56:56 +0100 Subject: [PATCH] Quick fix for null pointer --- .../net/Broken/Tools/UserManager/Stats/UserStatsUtils.java | 4 ++++ 1 file changed, 4 insertions(+) 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()){