修复定时器获取bot为空导致异常问题

This commit is contained in:
Yutousama 2022-04-28 09:56:56 +08:00
parent 7943606dc0
commit 4031b07b0b

View File

@ -33,6 +33,9 @@ public class ApplicationInit implements ApplicationRunner {
new Thread(() -> { new Thread(() -> {
try { try {
Bot bot = QQBotManager.getInstance().getBot(); Bot bot = QQBotManager.getInstance().getBot();
if(bot==null){
return;
}
Model useModel = (Model) model.getDeclaredConstructor().newInstance(); Model useModel = (Model) model.getDeclaredConstructor().newInstance();
for (Group group : bot.getGroups()) { for (Group group : bot.getGroups()) {
if (QQNumberManager.getManager().isUseModel(group.getId(), model)) { if (QQNumberManager.getManager().isUseModel(group.getId(), model)) {