Fix abuse crash on deleted video

pull/3787/head
Chocobozzz 2021-02-26 09:28:50 +01:00
parent 88cfa3e8fa
commit 494df94036
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 3 deletions

View File

@ -434,10 +434,10 @@ export class AbuseModel extends Model {
}
buildBaseVideoCommentAbuse (this: MAbuseUserFormattable) {
if (!this.VideoCommentAbuse) return null
// Associated video comment could have been destroyed if the video has been deleted
if (!this.VideoCommentAbuse || !this.VideoCommentAbuse.VideoComment) return null
const abuseModel = this.VideoCommentAbuse
const entity = abuseModel.VideoComment
const entity = this.VideoCommentAbuse.VideoComment
return {
id: entity.id,