forked from Fascinated/Bat
fix npe
This commit is contained in:
@ -12,12 +12,12 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class MongoService {
|
||||
public static MongoService INSTANCE;
|
||||
private final MongoTemplate mongo;
|
||||
private final MongoTemplate mongoTemplate;
|
||||
|
||||
@Autowired
|
||||
public MongoService(MongoTemplate mongo) {
|
||||
INSTANCE = this;
|
||||
this.mongo = mongo;
|
||||
this.mongoTemplate = mongo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@ public class MongoService {
|
||||
* @return The guilds collection
|
||||
*/
|
||||
public MongoCollection<Document> getGuildsCollection() {
|
||||
return mongo.getCollection("guilds");
|
||||
return mongoTemplate.getCollection("guilds");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -35,6 +35,6 @@ public class MongoService {
|
||||
* @return The users collection
|
||||
*/
|
||||
public MongoCollection<Document> getUsersCollection() {
|
||||
return mongo.getCollection("users");
|
||||
return mongoTemplate.getCollection("users");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user