Skip to content

Commit

Permalink
return chatie qrcode image when avatar exception (fix #1473)
Browse files Browse the repository at this point in the history
  • Loading branch information
huan committed Jul 13, 2018
1 parent 30cbde6 commit c677b96
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/user/contact.ts
Expand Up @@ -24,7 +24,8 @@ import {
log,
Raven,
Sayable,
} from '../config'
qrCodeForChatie,
} from '../config'
import {
Accessory,
} from '../accessory'
Expand Down Expand Up @@ -578,7 +579,13 @@ export class Contact extends Accessory implements Sayable {
public async avatar(): Promise<FileBox> {
log.verbose('Contact', 'avatar()')

return this.puppet.contactAvatar(this.id)
try {
const fileBox = await this.puppet.contactAvatar(this.id)
return fileBox
} catch (e) {
log.error('Contact', 'avatar() exception: %s', e.message)
return qrCodeForChatie()
}
}

/**
Expand Down

0 comments on commit c677b96

Please sign in to comment.