maybe fix a NPE??
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 41s
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 41s
This commit is contained in:
parent
048d2856f9
commit
35596b720b
@ -53,6 +53,11 @@ public class BatUser extends ProfileHolder {
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* The discord user associated with this user
|
||||
*/
|
||||
private User user;
|
||||
|
||||
public BatUser(@NonNull String id, @NonNull org.bson.Document document) {
|
||||
this.id = id;
|
||||
this.document = document;
|
||||
@ -61,6 +66,7 @@ public class BatUser extends ProfileHolder {
|
||||
|
||||
User user = DiscordService.JDA.getUserById(id);
|
||||
if (user != null) {
|
||||
this.user = user;
|
||||
this.globalName = user.getGlobalName();
|
||||
}
|
||||
}
|
||||
@ -78,7 +84,10 @@ public class BatUser extends ProfileHolder {
|
||||
* @return the guild
|
||||
*/
|
||||
public User getDiscordUser() {
|
||||
return DiscordService.JDA.getUserById(id);
|
||||
if (user == null) {
|
||||
user = DiscordService.JDA.getUserById(id);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user