forked from Fascinated/Bat
maybe fix some NPEs when calling events
This commit is contained in:
@ -54,14 +54,15 @@ public class BatUser extends ProfileHolder {
|
||||
*/
|
||||
private User user;
|
||||
|
||||
public BatUser(@NonNull String id, @NonNull org.bson.Document document) {
|
||||
public BatUser(@NonNull String id, User user, @NonNull org.bson.Document document) {
|
||||
this.id = id;
|
||||
this.document = document;
|
||||
boolean newAccount = this.document.isEmpty();
|
||||
this.createdAt = newAccount ? new Date() : document.getDate("createdAt");
|
||||
|
||||
User user = UserUtils.getUser(id);
|
||||
if (user != null) {
|
||||
// User was not passed through
|
||||
if (user == null) {
|
||||
user = UserUtils.getUser(id);
|
||||
this.user = user;
|
||||
this.globalName = user.getGlobalName();
|
||||
}
|
||||
|
Reference in New Issue
Block a user