diff --git a/src/routes/api/tree.js b/src/routes/api/tree.js index 95cd9d1c0..7874814c2 100644 --- a/src/routes/api/tree.js +++ b/src/routes/api/tree.js @@ -97,6 +97,11 @@ function getNotesAndBranchesAndAttributes(noteIds) { for (const attributeId of collectedAttributeIds) { const attribute = becca.attributes[attributeId]; + if (!attribute) { + log.error(`Could not find attribute for attributeId=${attributeId}`); + continue; + } + attributes.push({ attributeId: attribute.attributeId, noteId: attribute.noteId,