fix: sometimes summary is null/undefined

fixes
TypeError: Cannot read properties of null (reading 'replace')
    at /home/saas/nodebb/src/activitypub/mocks.js:202:24
This commit is contained in:
Barış Soner Uşaklı
2025-07-24 23:54:38 -04:00
parent 1262aee843
commit 65364bfa0f

View File

@@ -191,7 +191,7 @@ Mocks.profile = async (actors) => {
const iconBackgrounds = await user.getIconBackgrounds();
let bgColor = Array.prototype.reduce.call(preferredUsername, (cur, next) => cur + next.charCodeAt(), 0);
bgColor = iconBackgrounds[bgColor % iconBackgrounds.length];
summary = summary || '';
// Replace emoji in summary
if (tag && Array.isArray(tag)) {
tag