mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 02:25:55 +01:00
fix: filter null nav items
This commit is contained in:
@@ -65,7 +65,7 @@ admin.get = async function () {
|
|||||||
}
|
}
|
||||||
const ids = await db.getSortedSetRange('navigation:enabled', 0, -1);
|
const ids = await db.getSortedSetRange('navigation:enabled', 0, -1);
|
||||||
const data = await db.getObjects(ids.map(id => `navigation:enabled:${id}`));
|
const data = await db.getObjects(ids.map(id => `navigation:enabled:${id}`));
|
||||||
cache = data.map((item) => {
|
cache = data.filter(Boolean).map((item) => {
|
||||||
if (item.hasOwnProperty('groups')) {
|
if (item.hasOwnProperty('groups')) {
|
||||||
try {
|
try {
|
||||||
item.groups = JSON.parse(item.groups);
|
item.groups = JSON.parse(item.groups);
|
||||||
|
|||||||
Reference in New Issue
Block a user