Quick fix for null pointer
This commit is contained in:
parent
797988feae
commit
205f6498f2
@ -60,6 +60,10 @@ public class UserStatsUtils {
|
|||||||
|
|
||||||
public List<UserStats> getUserStats(UserEntity userEntity){
|
public List<UserStats> getUserStats(UserEntity userEntity){
|
||||||
User jdaUser = MainBot.jda.getUserById(userEntity.getJdaId());
|
User jdaUser = MainBot.jda.getUserById(userEntity.getJdaId());
|
||||||
|
//TODO clean database for deleted users
|
||||||
|
|
||||||
|
if(jdaUser == null)
|
||||||
|
return null;
|
||||||
logger.debug(userEntity);
|
logger.debug(userEntity);
|
||||||
logger.debug(userEntity.getUserStats());
|
logger.debug(userEntity.getUserStats());
|
||||||
if(userEntity.getUserStats() == null || userEntity.getUserStats().size() == 0 || userEntity.getUserStats().size() < jdaUser.getMutualGuilds().size()){
|
if(userEntity.getUserStats() == null || userEntity.getUserStats().size() == 0 || userEntity.getUserStats().size() < jdaUser.getMutualGuilds().size()){
|
||||||
|
Loading…
Reference in New Issue
Block a user