Skip to content

Node.js based forum software built for the modern web

fix: don't send custom fields in remote user actor object if no value is entered

Julian Lam09f00f8e43f2
diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js
index 9446302202..68e5c0210f 100644
--- a/src/activitypub/mocks.js
+++ b/src/activitypub/mocks.js
@@ -200,15 +200,15 @@ Mocks.actors.user = async (uid) => {
}
const attachment = [];
- if (fields.length) {
- fields.forEach(({ name, value }) => {
+ fields.forEach(({ name, value }) => {
+ if (value) {
attachment.push({
type: 'PropertyValue',
name,
value,
});
- });
- }
+ }
+ });
return {
'@context': [