Don't crash on error in notification popup
This commit is contained in:
parent
e1fa026675
commit
9b69bfc076
|
@ -63,6 +63,9 @@ export class UserNotification implements UserNotificationServer {
|
|||
this.type = hash.type
|
||||
this.read = hash.read
|
||||
|
||||
// We assume that some fields exist
|
||||
// To prevent a notification popup crash in case of bug, wrap it inside a try/catch
|
||||
try {
|
||||
this.video = hash.video
|
||||
if (this.video) this.setAvatarUrl(this.video.channel)
|
||||
|
||||
|
@ -131,6 +134,9 @@ export class UserNotification implements UserNotificationServer {
|
|||
this.accountUrl = this.buildAccountUrl(this.actorFollow.follower)
|
||||
break
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
||||
private buildVideoUrl (video: { uuid: string }) {
|
||||
|
|
Loading…
Reference in New Issue