From c428b2205cafe3bc3479e72660c2b8adfd16c310 Mon Sep 17 00:00:00 2001 From: Huan LI Date: Fri, 20 Mar 2020 00:05:01 +0800 Subject: [PATCH] check duplicated wechaty-puppet module installed (#1930) --- src/puppet-manager.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/puppet-manager.ts b/src/puppet-manager.ts index 963a5aad..14a20fbe 100644 --- a/src/puppet-manager.ts +++ b/src/puppet-manager.ts @@ -48,6 +48,14 @@ export class PuppetManager { */ if (options.puppet instanceof Puppet) { puppetInstance = await this.resolveInstance(options.puppet) + } else if (typeof options.puppet !== 'string') { + log.error('PuppetManager', 'resolve() %s', + ` + Wechaty Framework must keep only one Puppet instance #1930 + See: https://github.com/wechaty/wechaty/issues/1930 + `, + ) + throw new Error('Wechaty Framework must keep only one Puppet instance #1930') } else { const MyPuppet = await this.resolveName(options.puppet) /** -- GitLab