From 9cfeb3cf989fffccdfe3e575903dc00baab255b2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 17 Dec 2020 09:23:57 +0100 Subject: Fix redundancy federation in some cases --- server/lib/activitypub/send/send-update.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'server/lib/activitypub/send/send-update.ts') diff --git a/server/lib/activitypub/send/send-update.ts b/server/lib/activitypub/send/send-update.ts index 305edf429..bcf6e1569 100644 --- a/server/lib/activitypub/send/send-update.ts +++ b/server/lib/activitypub/send/send-update.ts @@ -75,7 +75,13 @@ async function sendUpdateActor (accountOrChannel: MChannelDefault | MAccountDefa async function sendUpdateCacheFile (byActor: MActorLight, redundancyModel: MVideoRedundancyVideo) { logger.info('Creating job to update cache file %s.', redundancyModel.url) - const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(redundancyModel.getVideo().id) + const associatedVideo = redundancyModel.getVideo() + if (!associatedVideo) { + logger.warn('Cannot send update activity for redundancy %s: no video files associated.', redundancyModel.url) + return + } + + const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(associatedVideo.id) const activityBuilder = (audience: ActivityAudience) => { const redundancyObject = redundancyModel.toActivityPubObject() -- cgit v1.2.3