fix npe and maybe fix null users????????
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s

This commit is contained in:
Lee
2024-07-04 01:33:24 +01:00
parent 2349f10b35
commit dc7e44239f
5 changed files with 45 additions and 5 deletions

View File

@ -3,6 +3,7 @@ package cc.fascinated.bat.model;
import cc.fascinated.bat.BatApplication;
import cc.fascinated.bat.common.ProfileHolder;
import cc.fascinated.bat.common.Serializable;
import cc.fascinated.bat.common.UserUtils;
import cc.fascinated.bat.features.namehistory.profile.user.NameHistoryProfile;
import cc.fascinated.bat.features.scoresaber.profile.user.ScoreSaberProfile;
import cc.fascinated.bat.service.DiscordService;
@ -59,7 +60,7 @@ public class BatUser extends ProfileHolder {
boolean newAccount = this.document.isEmpty();
this.createdAt = newAccount ? new Date() : document.getDate("createdAt");
User user = DiscordService.JDA.getUserById(id);
User user = UserUtils.getUser(id);
if (user != null) {
this.user = user;
this.globalName = user.getGlobalName();