aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-11-15 15:00:19 +0100
committerChocobozzz <me@florianbigard.com>2022-11-15 15:00:23 +0100
commit99b757488c077cee7d0ab89eeec181a7ee6290eb (patch)
tree307a3f39285f899e3ed616d92aae1bdd181178e0 /server/lib/job-queue
parent4638cd713dcdd007cd7f49b9a95fa62ac7823e7c (diff)
downloadPeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.tar.gz
PeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.tar.zst
PeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.zip
Fix server lint
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r--server/lib/job-queue/handlers/activitypub-cleaner.ts2
-rw-r--r--server/lib/job-queue/handlers/video-import.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/job-queue/handlers/activitypub-cleaner.ts b/server/lib/job-queue/handlers/activitypub-cleaner.ts
index 84c0a2de2..a25f00b0a 100644
--- a/server/lib/job-queue/handlers/activitypub-cleaner.ts
+++ b/server/lib/job-queue/handlers/activitypub-cleaner.ts
@@ -88,7 +88,7 @@ async function updateObjectIfNeeded <T> (options: {
88 const { body } = await doJSONRequest<any>(url, { activityPub: true }) 88 const { body } = await doJSONRequest<any>(url, { activityPub: true })
89 89
90 // If not same id, check same host and update 90 // If not same id, check same host and update
91 if (!body || !body.id || !bodyValidator(body)) throw new Error(`Body or body id of ${url} is invalid`) 91 if (!body?.id || !bodyValidator(body)) throw new Error(`Body or body id of ${url} is invalid`)
92 92
93 if (body.type === 'Tombstone') { 93 if (body.type === 'Tombstone') {
94 return on404OrTombstone() 94 return on404OrTombstone()
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts
index 83d582cb4..4d361c7b9 100644
--- a/server/lib/job-queue/handlers/video-import.ts
+++ b/server/lib/job-queue/handlers/video-import.ts
@@ -107,7 +107,7 @@ async function processYoutubeDLImport (job: Job, videoImport: MVideoImportDefaul
107 107
108async function getVideoImportOrDie (payload: VideoImportPayload) { 108async function getVideoImportOrDie (payload: VideoImportPayload) {
109 const videoImport = await VideoImportModel.loadAndPopulateVideo(payload.videoImportId) 109 const videoImport = await VideoImportModel.loadAndPopulateVideo(payload.videoImportId)
110 if (!videoImport || !videoImport.Video) { 110 if (!videoImport?.Video) {
111 throw new Error(`Cannot import video ${payload.videoImportId}: the video import or video linked to this import does not exist anymore.`) 111 throw new Error(`Cannot import video ${payload.videoImportId}: the video import or video linked to this import does not exist anymore.`)
112 } 112 }
113 113