Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix abuse crash on deleted video

Chocobozzz494df940364b
diff --git a/server/models/abuse/abuse.ts b/server/models/abuse/abuse.ts
index de249d2114..262f364f16 100644
--- a/server/models/abuse/abuse.ts
+++ b/server/models/abuse/abuse.ts
@@ -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,