diff --git a/core/server/api/canary/utils/serializers/output/utils/post-gating.js b/core/server/api/canary/utils/serializers/output/utils/post-gating.js index 465cc22b23..0511856d40 100644 --- a/core/server/api/canary/utils/serializers/output/utils/post-gating.js +++ b/core/server/api/canary/utils/serializers/output/utils/post-gating.js @@ -7,7 +7,9 @@ const forPost = (attrs, frame) => { if (!memberHasAccess) { ['plaintext', 'html'].forEach((field) => { - attrs[field] = ''; + if (attrs[field] !== undefined) { + attrs[field] = ''; + } }); } } diff --git a/core/server/api/v2/utils/serializers/output/utils/post-gating.js b/core/server/api/v2/utils/serializers/output/utils/post-gating.js index 465cc22b23..0511856d40 100644 --- a/core/server/api/v2/utils/serializers/output/utils/post-gating.js +++ b/core/server/api/v2/utils/serializers/output/utils/post-gating.js @@ -7,7 +7,9 @@ const forPost = (attrs, frame) => { if (!memberHasAccess) { ['plaintext', 'html'].forEach((field) => { - attrs[field] = ''; + if (attrs[field] !== undefined) { + attrs[field] = ''; + } }); } }