mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: don't crash if fullname is not a string
https://community.nodebb.org/topic/15291/upgrade-error-fullname-substr-is-not-a-function
This commit is contained in:
committed by
GitHub
parent
1374e0eeba
commit
4fb907875e
@@ -16,7 +16,7 @@ module.exports = {
|
||||
const userData = await user.getUsersFields(uids, ['uid', 'fullname']);
|
||||
const bulkAdd = userData
|
||||
.filter(u => u.uid && u.fullname)
|
||||
.map(u => ['fullname:sorted', 0, u.fullname.substr(0, 255).toLowerCase() + ':' + u.uid]);
|
||||
.map(u => ['fullname:sorted', 0, String(u.fullname).substr(0, 255).toLowerCase() + ':' + u.uid]);
|
||||
await db.sortedSetAddBulk(bulkAdd);
|
||||
}, {
|
||||
batch: 500,
|
||||
|
||||
Reference in New Issue
Block a user