mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-16 11:37:37 +01:00
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:
@@ -191,7 +191,7 @@ Mocks.profile = async (actors) => {
|
|||||||
const iconBackgrounds = await user.getIconBackgrounds();
|
const iconBackgrounds = await user.getIconBackgrounds();
|
||||||
let bgColor = Array.prototype.reduce.call(preferredUsername, (cur, next) => cur + next.charCodeAt(), 0);
|
let bgColor = Array.prototype.reduce.call(preferredUsername, (cur, next) => cur + next.charCodeAt(), 0);
|
||||||
bgColor = iconBackgrounds[bgColor % iconBackgrounds.length];
|
bgColor = iconBackgrounds[bgColor % iconBackgrounds.length];
|
||||||
|
summary = summary || '';
|
||||||
// Replace emoji in summary
|
// Replace emoji in summary
|
||||||
if (tag && Array.isArray(tag)) {
|
if (tag && Array.isArray(tag)) {
|
||||||
tag
|
tag
|
||||||
|
|||||||
Reference in New Issue
Block a user