From e57b54a095f60b460153f8a4e86db4186bb45930 Mon Sep 17 00:00:00 2001 From: "Zhuohuan LI (CARPE DIEM)" Date: Mon, 10 Oct 2016 22:36:06 +0800 Subject: [PATCH] fix `profile` null bug --- src/wechaty.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wechaty.ts b/src/wechaty.ts index ad9c2287..e80e74d5 100644 --- a/src/wechaty.ts +++ b/src/wechaty.ts @@ -57,9 +57,11 @@ class Wechaty extends EventEmitter { // setting.port = setting.port || Config.port setting.profile = setting.profile || Config.profile // no profile, no session save/restore - setting.profile = /\.wechaty\.json$/i.test(setting.profile) + if (setting.profile) { + setting.profile = /\.wechaty\.json$/i.test(setting.profile) ? setting.profile : setting.profile + '.wechaty.json' + } this.npmVersion = require('../package.json').version -- GitLab