Skip to content

Node.js based forum software built for the modern web

fix: another case

Julian Lam6bfe4e627d8b
diff --git a/src/controllers/activitypub/index.js b/src/controllers/activitypub/index.js
index 583d437ffb..36054d6616 100644
--- a/src/controllers/activitypub/index.js
+++ b/src/controllers/activitypub/index.js
@@ -71,13 +71,15 @@ Controller.getFollowing = async (req, res) => {
url: `${nconf.get('url')}/uid/${req.params.uid}/following`,
});
- collection.orderedItems = collection.orderedItems.map(({ uid }) => {
- if (utils.isNumber(uid)) {
- return `${nconf.get('url')}/uid/${uid}`;
- }
+ if (collection.hasOwnProperty('orderedItems')) {
+ collection.orderedItems = collection.orderedItems.map(({ uid }) => {
+ if (utils.isNumber(uid)) {
+ return `${nconf.get('url')}/uid/${uid}`;
+ }
- return uid;
- });
+ return uid;
+ });
+ }
res.status(200).json(collection);
};