diff --git a/src/wechaty.ts b/src/wechaty.ts index c93b545ce8ce4d17b42b864445d6d0631045e569..19e2df1e8dedf66075f4a033a345f0fd344582ae 100644 --- a/src/wechaty.ts +++ b/src/wechaty.ts @@ -570,7 +570,10 @@ export class Wechaty extends EventEmitter implements Sayable { for (const plugin of plugins) { try { const future = plugin(this) - if (future) { + /** + * We check `future.catch` at here is to prevent some plugin that return something other than `void`(undefined) + */ + if (future && typeof future.catch === 'function') { future.catch(e => { log.error('Wechaty', 'use(%s) rejection: %s', plugin.name,