fix for npe??

This commit is contained in:
Lee 2024-07-01 21:49:02 +01:00
parent 3082265ec6
commit c6289d1c8e
2 changed files with 4 additions and 2 deletions

@ -113,6 +113,7 @@ public class BatGuild extends ProfileHolder {
* Saves the user
*/
public void save() {
org.bson.Document document = new org.bson.Document();
document.put("_id", id);
document.put("createdAt", createdAt);
@ -124,7 +125,7 @@ public class BatGuild extends ProfileHolder {
MongoService.INSTANCE.getGuildsCollection().replaceOne(
new org.bson.Document("_id", id),
this.getDocument(),
document,
new ReplaceOptions().upsert(true)
);
}

@ -103,6 +103,7 @@ public class BatUser extends ProfileHolder {
* Saves the user
*/
public void save() {
org.bson.Document document = new org.bson.Document();
document.put("_id", id);
document.put("createdAt", createdAt);
@ -114,7 +115,7 @@ public class BatUser extends ProfileHolder {
MongoService.INSTANCE.getUsersCollection().replaceOne(
new org.bson.Document("_id", id),
this.getDocument(),
document,
new ReplaceOptions().upsert(true)
);
}