提交 dda941b0 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

fix #54

上级 6cbb4673
......@@ -134,7 +134,12 @@ export class Wechaty extends EventEmitter implements Sayable {
return this.npmVersion
}
public user(): Contact | null { return this.puppet && this.puppet.user }
public user(): Contact {
if (!this.puppet || !this.puppet.user) {
throw new Error('no user')
}
return this.puppet.user
}
public reset(reason?: string) {
log.verbose('Wechaty', 'reset() because %s', reason)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册