3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

fix: fix errors when unloading certain plugins after beforeLoad but before afterLoad

This commit is contained in:
Dragory 2021-10-31 16:48:32 +02:00
parent 4f811f04e1
commit f92ee9ba4f
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
5 changed files with 22 additions and 10 deletions

View file

@ -212,8 +212,10 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
},
beforeUnload(pluginData) {
for (const interval of pluginData.state.decayTimers) {
clearInterval(interval);
if (pluginData.state.decayTimers) {
for (const interval of pluginData.state.decayTimers) {
clearInterval(interval);
}
}
pluginData.state.events.removeAllListeners();