aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-26 09:28:50 +0100
committerChocobozzz <me@florianbigard.com>2021-02-26 09:28:50 +0100
commit494df940364b98730ae06ed08e94e5742b40a4d2 (patch)
treece9c19c178c5205ddb482f0e14d1e614eb28b07b
parent88cfa3e8fa8417f14a905c089e57e1648f5a3846 (diff)
downloadPeerTube-494df940364b98730ae06ed08e94e5742b40a4d2.tar.gz
PeerTube-494df940364b98730ae06ed08e94e5742b40a4d2.tar.zst
PeerTube-494df940364b98730ae06ed08e94e5742b40a4d2.zip
Fix abuse crash on deleted video
-rw-r--r--server/models/abuse/abuse.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/models/abuse/abuse.ts b/server/models/abuse/abuse.ts
index de249d211..262f364f1 100644
--- a/server/models/abuse/abuse.ts
+++ b/server/models/abuse/abuse.ts
@@ -434,10 +434,10 @@ export class AbuseModel extends Model {
434 } 434 }
435 435
436 buildBaseVideoCommentAbuse (this: MAbuseUserFormattable) { 436 buildBaseVideoCommentAbuse (this: MAbuseUserFormattable) {
437 if (!this.VideoCommentAbuse) return null 437 // Associated video comment could have been destroyed if the video has been deleted
438 if (!this.VideoCommentAbuse || !this.VideoCommentAbuse.VideoComment) return null
438 439
439 const abuseModel = this.VideoCommentAbuse 440 const entity = this.VideoCommentAbuse.VideoComment
440 const entity = abuseModel.VideoComment
441 441
442 return { 442 return {
443 id: entity.id, 443 id: entity.id,