mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-30 06:37:36 +00:00
[Fix] MiraiMain 修复未登录时异常退出, 抛出NPE的问题;
This commit is contained in:
parent
a170ff040b
commit
7943357d96
@ -73,9 +73,16 @@ public class MiraiMain implements Closeable {
|
|||||||
BotEventHandler.executeMessageEvent(new MiraiMessageEvent(message));
|
BotEventHandler.executeMessageEvent(new MiraiMessageEvent(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭机器人
|
||||||
|
*/
|
||||||
public void close() {
|
public void close() {
|
||||||
|
if(bot == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
log.warn("正在关闭机器人...");
|
log.warn("正在关闭机器人...");
|
||||||
bot.close(null);
|
bot.close(null);
|
||||||
|
bot = null;
|
||||||
log.warn("机器人已关闭.");
|
log.warn("机器人已关闭.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user