]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix comments feed
authorChocobozzz <me@florianbigard.com>
Wed, 11 Dec 2019 17:06:41 +0000 (18:06 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 11 Dec 2019 17:06:41 +0000 (18:06 +0100)
server/controllers/feeds.ts

index ba5a476e7acbc7831137d109902cd161acd010ad..fa6c7ac714869a6ecba7795fe791d83025a1c6f9 100644 (file)
@@ -57,19 +57,22 @@ async function generateVideoCommentsFeed (req: express.Request, res: express.Res
     const link = WEBSERVER.URL + comment.getCommentStaticPath()
 
     let title = comment.Video.name
-    if (comment.Account) title += ` - ${comment.Account.getDisplayName()}`
+    const author: { name: string, link: string }[] = []
+
+    if (comment.Account) {
+      title += ` - ${comment.Account.getDisplayName()}`
+      author.push({
+        name: comment.Account.getDisplayName(),
+        link: comment.Account.Actor.url
+      })
+    }
 
     feed.addItem({
       title,
       id: comment.url,
       link,
       content: comment.text,
-      author: [
-        {
-          name: comment.Account.getDisplayName(),
-          link: comment.Account.Actor.url
-        }
-      ],
+      author,
       date: comment.createdAt
     })
   })